Browse Source

Use proper method for checking value existence

adaptive-webui-19844
Chocobo1 3 years ago
parent
commit
cbc2de6b85
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 2
      src/app/upgrade.cpp

2
src/app/upgrade.cpp

@ -255,7 +255,7 @@ void handleChangedDefaults(const DefaultPreferencesMode mode)
SettingsStorage *settingsStorage {SettingsStorage::instance()}; SettingsStorage *settingsStorage {SettingsStorage::instance()};
for (auto it = changedDefaults.cbegin(); it != changedDefaults.cend(); ++it) for (auto it = changedDefaults.cbegin(); it != changedDefaults.cend(); ++it)
{ {
if (settingsStorage->loadValue<QVariant>(it->name).isNull()) if (!settingsStorage->hasKey(it->name))
settingsStorage->storeValue(it->name, (mode == DefaultPreferencesMode::Legacy ? it->legacy : it->current)); settingsStorage->storeValue(it->name, (mode == DefaultPreferencesMode::Legacy ? it->legacy : it->current));
} }
} }

Loading…
Cancel
Save