mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(settings): Look for portable setting in module path, not CWD
This commit is contained in:
parent
7c63594adf
commit
17e57982df
|
@ -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();
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user