Use proper method for checking value existence

This commit is contained in:
Chocobo1 2021-12-05 03:11:51 +08:00
parent 9d2bb67834
commit cbc2de6b85
No known key found for this signature in database
GPG key ID: 210D9C873253A68C

View file

@ -255,7 +255,7 @@ void handleChangedDefaults(const DefaultPreferencesMode mode)
SettingsStorage *settingsStorage {SettingsStorage::instance()};
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));
}
}