|
|
|
@ -715,6 +715,8 @@ QString Settings::getSettingsDirPath() const
@@ -715,6 +715,8 @@ QString Settings::getSettingsDirPath() const
|
|
|
|
|
if (makeToxPortable) |
|
|
|
|
return qApp->applicationDirPath() + QDir::separator(); |
|
|
|
|
|
|
|
|
|
QString path; |
|
|
|
|
#if (QT_VERSION < QT_VERSION_CHECK(5, 4, 0)) |
|
|
|
|
// workaround for https://bugreports.qt-project.org/browse/QTBUG-38845
|
|
|
|
|
# ifdef Q_OS_WIN |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) |
|
|
|
@ -731,6 +733,18 @@ QString Settings::getSettingsDirPath() const
@@ -731,6 +733,18 @@ QString Settings::getSettingsDirPath() const
|
|
|
|
|
+ QDir::separator() + "tox") |
|
|
|
|
+ QDir::separator(); |
|
|
|
|
# endif |
|
|
|
|
#else |
|
|
|
|
# ifdef Q_OS_WIN |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) |
|
|
|
|
+ QDir::separator() + "tox") + QDir::separator(); |
|
|
|
|
# elif defined(Q_OS_OSX) |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) |
|
|
|
|
+ QDir::separator() + "Tox") + QDir::separator(); |
|
|
|
|
# else |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) |
|
|
|
|
+ QDir::separator() + "tox") + QDir::separator(); |
|
|
|
|
# endif |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -743,6 +757,7 @@ QString Settings::getAppDataDirPath() const
@@ -743,6 +757,7 @@ QString Settings::getAppDataDirPath() const
|
|
|
|
|
if (makeToxPortable) |
|
|
|
|
return qApp->applicationDirPath() + QDir::separator(); |
|
|
|
|
|
|
|
|
|
#if (QT_VERSION < QT_VERSION_CHECK(5, 4, 0)) |
|
|
|
|
// workaround for https://bugreports.qt-project.org/browse/QTBUG-38845
|
|
|
|
|
# ifdef Q_OS_WIN |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) |
|
|
|
@ -755,14 +770,19 @@ QString Settings::getAppDataDirPath() const
@@ -755,14 +770,19 @@ QString Settings::getAppDataDirPath() const
|
|
|
|
|
+ "Application Support" + QDir::separator() + "Tox") |
|
|
|
|
+ QDir::separator(); |
|
|
|
|
# else |
|
|
|
|
/*
|
|
|
|
|
* TODO: Change QStandardPaths::DataLocation to AppDataLocation when upgrate Qt to 5.4+ |
|
|
|
|
* For now we need support Qt 5.3, so we use deprecated DataLocation |
|
|
|
|
* BTW, it's not a big deal since for linux AppDataLocation and DataLocation are equal |
|
|
|
|
*/ |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::DataLocation)) |
|
|
|
|
+ QDir::separator(); |
|
|
|
|
# endif |
|
|
|
|
#else |
|
|
|
|
# if defined(Q_OS_OSX) |
|
|
|
|
# elif defined(Q_OS_OSX) |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) |
|
|
|
|
+ QDir::separator() + "Tox") + QDir::separator(); |
|
|
|
|
# else |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) |
|
|
|
|
+ QDir::separator() + "tox") + QDir::separator(); |
|
|
|
|
# endif |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -775,6 +795,7 @@ QString Settings::getAppCacheDirPath() const
@@ -775,6 +795,7 @@ QString Settings::getAppCacheDirPath() const
|
|
|
|
|
if (makeToxPortable) |
|
|
|
|
return qApp->applicationDirPath() + QDir::separator(); |
|
|
|
|
|
|
|
|
|
#if (QT_VERSION < QT_VERSION_CHECK(5, 4, 0)) |
|
|
|
|
// workaround for https://bugreports.qt-project.org/browse/QTBUG-38845
|
|
|
|
|
# ifdef Q_OS_WIN |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) |
|
|
|
@ -790,6 +811,18 @@ QString Settings::getAppCacheDirPath() const
@@ -790,6 +811,18 @@ QString Settings::getAppCacheDirPath() const
|
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)) |
|
|
|
|
+ QDir::separator(); |
|
|
|
|
# endif |
|
|
|
|
#else |
|
|
|
|
# ifdef Q_OS_WIN |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) |
|
|
|
|
+ QDir::separator() + "tox") + QDir::separator(); |
|
|
|
|
# elif defined(Q_OS_OSX) |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) |
|
|
|
|
+ QDir::separator() + "Tox") + QDir::separator(); |
|
|
|
|
# else |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)) |
|
|
|
|
+ QDir::separator(); |
|
|
|
|
# endif |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const QList<DhtServer>& Settings::getDhtServerList() const |
|
|
|
|