X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/blobdiff_plain/68efead17e2f90bdccb5c6b2aed256e5556ae0a0..9b513f664c272fcb57d54b68acf65a879384ae02:/src/gui/settingsdialog.cpp diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index 3e29c78..91f5fdc 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -35,9 +35,9 @@ void SettingsDialog::loadDialogData() // deserialize dialog data address->setText(AppSettings::proxyAddress()); port->setValue(AppSettings::proxyPort()); - const int proxyType = AppSettings::proxyType(); // QNetworkProxy::ProxyType - proxyTypeHTTP->setChecked(proxyType != 1); // HTTP=3, but we enable it by default, i.e. unless SOCKS5=1 - proxyTypeSOCKS5->setChecked(proxyType == 1); + const QNetworkProxy::ProxyType proxyType = AppSettings::proxyType(); + proxyTypeHTTP->setChecked(proxyType != QNetworkProxy::Socks5Proxy); // we enable it by default unless SOCKS5=1 + proxyTypeSOCKS5->setChecked(proxyType == QNetworkProxy::Socks5Proxy); directConnection->setChecked(AppSettings::isDirectConnection()); proxyWidget->setDisabled(directConnection->isChecked()); } @@ -48,7 +48,7 @@ void SettingsDialog::saveDialogData() // serialize dialog data AppSettings::setProxyAddress(address->text()); AppSettings::setProxyPort(port->value()); - AppSettings::setProxyType(proxyTypeHTTP->isChecked() ? 3 : proxyTypeSOCKS5->isChecked() ? 1 : 0); + AppSettings::setProxyType(proxyTypeHTTP->isChecked() ? QNetworkProxy::HttpProxy : proxyTypeSOCKS5->isChecked() ? QNetworkProxy::Socks5Proxy : QNetworkProxy::DefaultProxy); AppSettings::setDirectConnection(directConnection->isChecked()); }