Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(settings): Look for portable setting in module path, not CWD
Browse files Browse the repository at this point in the history
  • Loading branch information
tux3 committed May 9, 2016
1 parent 7c63594 commit 17e5798
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/persistence/settings.cpp
Expand Up @@ -95,9 +95,9 @@ void Settings::loadGlobal()

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.beginGroup("General");
makeToxPortable = ps.value("makeToxPortable", false).toBool();
Expand Down Expand Up @@ -583,7 +583,7 @@ QString Settings::getSettingsDirPath()
{
QMutexLocker locker{&bigLock};
if (makeToxPortable)
return QString(".")+QDir::separator();
return qApp->applicationDirPath()+QDir::separator();

// workaround for https://bugreports.qt-project.org/browse/QTBUG-38845
#ifdef Q_OS_WIN
Expand All @@ -602,7 +602,7 @@ QString Settings::getAppDataDirPath()
{
QMutexLocker locker{&bigLock};
if (makeToxPortable)
return QString(".")+QDir::separator();
return qApp->applicationDirPath()+QDir::separator();

// workaround for https://bugreports.qt-project.org/browse/QTBUG-38845
#ifdef Q_OS_WIN
Expand All @@ -623,7 +623,7 @@ QString Settings::getAppCacheDirPath()
{
QMutexLocker locker{&bigLock};
if (makeToxPortable)
return QString(".")+QDir::separator();
return qApp->applicationDirPath()+QDir::separator();

// workaround for https://bugreports.qt-project.org/browse/QTBUG-38845
#ifdef Q_OS_WIN
Expand Down

0 comments on commit 17e5798

Please sign in to comment.