Drop upgrade code

This commit is contained in:
sledgehammer999 2018-12-27 22:04:48 +02:00
parent 6236aee8d5
commit 1fff760722
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2
4 changed files with 9 additions and 313 deletions

View file

@ -1453,31 +1453,6 @@ void Preferences::setSpeedWidgetGraphEnable(int id, const bool enable)
setValue("SpeedWidget/graph_enable_" + QString::number(id), enable);
}
void Preferences::upgrade()
{
SettingsStorage *settingsStorage = SettingsStorage::instance();
const QStringList labels = value("TransferListFilters/customLabels").toStringList();
if (!labels.isEmpty()) {
QVariantMap categories = value("BitTorrent/Session/Categories").toMap();
for (const QString &label : labels) {
if (!categories.contains(label))
categories[label] = "";
}
setValue("BitTorrent/Session/Categories", categories);
settingsStorage->removeValue("TransferListFilters/customLabels");
}
settingsStorage->removeValue("Preferences/Downloads/AppendLabel");
// Inhibit sleep based on running downloads/available seeds rather than network activity.
if (value("Preferences/General/PreventFromSuspend", false).toBool()) {
setPreventFromSuspendWhenDownloading(true);
setPreventFromSuspendWhenSeeding(true);
}
settingsStorage->removeValue("Preferences/General/PreventFromSuspend");
}
void Preferences::apply()
{
if (SettingsStorage::instance()->save())