-
Notifications
You must be signed in to change notification settings - Fork 34
/
sqpath.h
46 lines (39 loc) · 959 Bytes
/
sqpath.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef SQPATH_H
#define SQPATH_H
#include <QStandardPaths>
#include <QString>
#ifdef SQPROJECT_STANDALONE
#define __SQ_STANDALONE
#endif
#ifndef SQPROJECT_INSTALLED
#define __SQ_STANDALONE
#endif
namespace SQPath {
static const QString translationsPath()
{
#if defined(__SQ_STANDALONE) || defined(SQPROJECT_WINDOWS_INSTALL)
return qApp->applicationDirPath() + "/i18n/";
#endif
#ifdef SQPROJECT_TRANSLATIONS_PATH
return QString("%1/i18n/").arg(SQPROJECT_TRANSLATIONS_PATH);
#endif
return "";
}
static const QString softwareDatasPath()
{
#if defined(__SQ_STANDALONE) || defined(SQPROJECT_WINDOWS_INSTALL)
return qApp->applicationDirPath();
#endif
#ifdef SQPROJECT_UNIX_APP_SHARE
return SQPROJECT_UNIX_APP_SHARE;
#endif
}
static const QString logDirectoryPath()
{
#ifdef __SQ_STANDALONE
return qApp->applicationDirPath();
#endif
return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
}
}
#endif // SQPATH_H