mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 07:27:22 -06:00
Keep legacy defaults for existing users
This commit is contained in:
@@ -82,3 +82,23 @@ bool upgrade(const bool /*ask*/)
|
||||
exportWebUIHttpsFiles();
|
||||
return true;
|
||||
}
|
||||
|
||||
void handleChangedDefaults(const DefaultPreferencesMode mode)
|
||||
{
|
||||
struct DefaultValue
|
||||
{
|
||||
QString name;
|
||||
QVariant legacy;
|
||||
QVariant current;
|
||||
};
|
||||
|
||||
const QVector<DefaultValue> changedDefaults {
|
||||
{QLatin1String {"BitTorrent/Session/QueueingSystemEnabled"}, true, false}
|
||||
};
|
||||
|
||||
SettingsStorage *settingsStorage {SettingsStorage::instance()};
|
||||
for (auto it = changedDefaults.cbegin(); it != changedDefaults.cend(); ++it) {
|
||||
if (settingsStorage->loadValue(it->name).isNull())
|
||||
settingsStorage->storeValue(it->name, (mode == DefaultPreferencesMode::Legacy ? it->legacy : it->current));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user