Get intended default values for bw limit settings for account when nothing is set

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-07-08 00:09:17 +08:00
parent 2803690285
commit 2d0c069039
No known key found for this signature in database
GPG key ID: C839200C384636B0

View file

@ -490,8 +490,16 @@ AccountPtr AccountManager::loadAccountHelper(QSettings &settings)
acc->setProxyPort(settings.value(networkProxyPortC).toInt());
acc->setProxyNeedsAuth(settings.value(networkProxyNeedsAuthC).toBool());
acc->setProxyUser(settings.value(networkProxyUserC).toString());
acc->setUploadLimitSetting(settings.value(networkUploadLimitSettingC).value<Account::AccountNetworkTransferLimitSetting>());
acc->setDownloadLimitSetting(settings.value(networkDownloadLimitSettingC).value<Account::AccountNetworkTransferLimitSetting>());
acc->setUploadLimitSetting(
settings.value(
networkUploadLimitSettingC,
QVariant::fromValue(Account::AccountNetworkTransferLimitSetting::GlobalLimit)
).value<Account::AccountNetworkTransferLimitSetting>());
acc->setDownloadLimitSetting(
settings.value(
networkDownloadLimitSettingC,
QVariant::fromValue(Account::AccountNetworkTransferLimitSetting::GlobalLimit)
).value<Account::AccountNetworkTransferLimitSetting>());
acc->setUploadLimit(settings.value(networkUploadLimitC).toInt());
acc->setDownloadLimit(settings.value(networkDownloadLimitC).toInt());