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

refactor(startup): return early in makeToxPortable logic

This commit is contained in:
jenli669 2019-06-24 02:04:02 +02:00
parent 72b39adb75
commit f1b6df400f
No known key found for this signature in database
GPG Key ID: 8267F9F7C2BF7E5E

View File

@ -268,17 +268,15 @@ void Settings::loadGlobal()
bool Settings::isToxPortable()
{
QString localSettingsPath = qApp->applicationDirPath() + QDir::separator() + globalSettingsFile;
bool result;
if (QFile(localSettingsPath).exists()) {
QSettings ps(localSettingsPath, QSettings::IniFormat);
ps.setIniCodec("UTF-8");
ps.beginGroup("Advanced");
result = ps.value("makeToxPortable", false).toBool();
ps.endGroup();
return result;
if (!QFile(localSettingsPath).exists()) {
return false;
}
return false;
QSettings ps(localSettingsPath, QSettings::IniFormat);
ps.setIniCodec("UTF-8");
ps.beginGroup("Advanced");
bool result = ps.value("makeToxPortable", false).toBool();
ps.endGroup();
return result;
}
void Settings::updateProfileData(Profile *profile)