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:
parent
72b39adb75
commit
f1b6df400f
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user