mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
Use spinbox special value to represent "Use any available port"
WebAPI functionality is preserved (deprecated) for now and should be removed in the future.
This commit is contained in:
@@ -102,12 +102,28 @@ namespace
|
||||
settingsStorage->storeValue(newKey, Utils::String::fromEnum(torrentContentLayout));
|
||||
settingsStorage->removeValue(oldKey);
|
||||
}
|
||||
|
||||
void upgradeListenPortSettings()
|
||||
{
|
||||
const auto oldKey = QString::fromLatin1("BitTorrent/Session/UseRandomPort");
|
||||
const auto newKey = QString::fromLatin1("Preferences/Connection/PortRangeMin");
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
|
||||
if (settingsStorage->hasKey(oldKey))
|
||||
{
|
||||
if (settingsStorage->loadValue<bool>(oldKey))
|
||||
settingsStorage->storeValue(newKey, 0);
|
||||
|
||||
settingsStorage->removeValue(oldKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool upgrade(const bool /*ask*/)
|
||||
{
|
||||
exportWebUIHttpsFiles();
|
||||
upgradeTorrentContentLayout();
|
||||
upgradeListenPortSettings();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user