|
|
|
@ -551,6 +551,44 @@ QString Settings::getSettingsDirPath()
@@ -551,6 +551,44 @@ QString Settings::getSettingsDirPath()
|
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QString Settings::getAppDataDirPath() |
|
|
|
|
{ |
|
|
|
|
QMutexLocker locker{&bigLock}; |
|
|
|
|
if (makeToxPortable) |
|
|
|
|
return QString(".")+QDir::separator(); |
|
|
|
|
|
|
|
|
|
// workaround for https://bugreports.qt-project.org/browse/QTBUG-38845
|
|
|
|
|
#ifdef Q_OS_WIN |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + QDir::separator() |
|
|
|
|
+ "AppData" + QDir::separator() + "Roaming" + QDir::separator() + "tox")+QDir::separator(); |
|
|
|
|
#elif defined(Q_OS_OSX) |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + QDir::separator() |
|
|
|
|
+ "Library" + QDir::separator() + "Application Support" + QDir::separator() + "Tox")+QDir::separator(); |
|
|
|
|
#else |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) |
|
|
|
|
+ QDir::separator() + "tox")+QDir::separator(); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QString Settings::getAppCacheDirPath() |
|
|
|
|
{ |
|
|
|
|
QMutexLocker locker{&bigLock}; |
|
|
|
|
if (makeToxPortable) |
|
|
|
|
return QString(".")+QDir::separator(); |
|
|
|
|
|
|
|
|
|
// workaround for https://bugreports.qt-project.org/browse/QTBUG-38845
|
|
|
|
|
#ifdef Q_OS_WIN |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + QDir::separator() |
|
|
|
|
+ "AppData" + QDir::separator() + "Roaming" + QDir::separator() + "tox")+QDir::separator(); |
|
|
|
|
#elif defined(Q_OS_OSX) |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + QDir::separator() |
|
|
|
|
+ "Library" + QDir::separator() + "Application Support" + QDir::separator() + "Tox")+QDir::separator(); |
|
|
|
|
#else |
|
|
|
|
return QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) |
|
|
|
|
+ QDir::separator() + "tox")+QDir::separator(); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const QList<DhtServer>& Settings::getDhtServerList() const |
|
|
|
|
{ |
|
|
|
|
QMutexLocker locker{&bigLock}; |
|
|
|
|