Correctly load global proxy setting state on account-specific network settings

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-07-07 20:42:43 +08:00
parent 480828bbbb
commit 9c856d29d4
No known key found for this signature in database
GPG key ID: C839200C384636B0

View file

@ -134,20 +134,24 @@ void NetworkSettings::loadProxySettings()
const auto proxyPassword = useGlobalProxy ? cfgFile.proxyPassword() : _account->proxyPassword();
// load current proxy settings
switch (proxyType) {
case QNetworkProxy::NoProxy:
_ui->noProxyRadioButton->setChecked(true);
break;
case QNetworkProxy::DefaultProxy:
_ui->systemProxyRadioButton->setChecked(true);
break;
case QNetworkProxy::Socks5Proxy:
case QNetworkProxy::HttpProxy:
_ui->typeComboBox->setCurrentIndex(_ui->typeComboBox->findData(proxyType));
_ui->manualProxyRadioButton->setChecked(true);
break;
default:
break;
if (_account && _account->networkProxySetting() == Account::AccountNetworkProxySetting::GlobalProxy) {
_ui->globalProxySettingsRadioButton->setChecked(true);
} else {
switch (proxyType) {
case QNetworkProxy::NoProxy:
_ui->noProxyRadioButton->setChecked(true);
break;
case QNetworkProxy::DefaultProxy:
_ui->systemProxyRadioButton->setChecked(true);
break;
case QNetworkProxy::Socks5Proxy:
case QNetworkProxy::HttpProxy:
_ui->typeComboBox->setCurrentIndex(_ui->typeComboBox->findData(proxyType));
_ui->manualProxyRadioButton->setChecked(true);
break;
default:
break;
}
}
_ui->hostLineEdit->setText(proxyHostName);