mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 13:04:23 +00:00
Use proper method for checking value existence
This commit is contained in:
parent
9d2bb67834
commit
cbc2de6b85
@ -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…
x
Reference in New Issue
Block a user