1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge pull request #3280

tux3 (1):
      fix(settings): Look for portable setting in module path, not CWD
This commit is contained in:
tux3 2016-05-09 16:12:10 +02:00
commit e5d146f16f
No known key found for this signature in database
GPG Key ID: 7E086DD661263264

View File

@ -95,9 +95,9 @@ void Settings::loadGlobal()
createSettingsDir(); createSettingsDir();
if (QFile(globalSettingsFile).exists()) if (QFile(qApp->applicationDirPath()+QDir::separator()+globalSettingsFile).exists())
{ {
QSettings ps(globalSettingsFile, QSettings::IniFormat); QSettings ps(qApp->applicationDirPath()+QDir::separator()+globalSettingsFile, QSettings::IniFormat);
ps.setIniCodec("UTF-8"); ps.setIniCodec("UTF-8");
ps.beginGroup("General"); ps.beginGroup("General");
makeToxPortable = ps.value("makeToxPortable", false).toBool(); makeToxPortable = ps.value("makeToxPortable", false).toBool();
@ -583,7 +583,7 @@ QString Settings::getSettingsDirPath()
{ {
QMutexLocker locker{&bigLock}; QMutexLocker locker{&bigLock};
if (makeToxPortable) if (makeToxPortable)
return QString(".")+QDir::separator(); return qApp->applicationDirPath()+QDir::separator();
// workaround for https://bugreports.qt-project.org/browse/QTBUG-38845 // workaround for https://bugreports.qt-project.org/browse/QTBUG-38845
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
@ -602,7 +602,7 @@ QString Settings::getAppDataDirPath()
{ {
QMutexLocker locker{&bigLock}; QMutexLocker locker{&bigLock};
if (makeToxPortable) if (makeToxPortable)
return QString(".")+QDir::separator(); return qApp->applicationDirPath()+QDir::separator();
// workaround for https://bugreports.qt-project.org/browse/QTBUG-38845 // workaround for https://bugreports.qt-project.org/browse/QTBUG-38845
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
@ -623,7 +623,7 @@ QString Settings::getAppCacheDirPath()
{ {
QMutexLocker locker{&bigLock}; QMutexLocker locker{&bigLock};
if (makeToxPortable) if (makeToxPortable)
return QString(".")+QDir::separator(); return qApp->applicationDirPath()+QDir::separator();
// workaround for https://bugreports.qt-project.org/browse/QTBUG-38845 // workaround for https://bugreports.qt-project.org/browse/QTBUG-38845
#ifdef Q_OS_WIN #ifdef Q_OS_WIN