From 6c07f08175f031ce70cc0b7512343b03e6f898b6 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Fri, 11 Mar 2016 16:21:40 +0100 Subject: [PATCH] Proxies: Enable ownBrander to force system proxy usage #4458 --- src/gui/networksettings.cpp | 5 +++++ src/libsync/configfile.cpp | 3 +++ src/libsync/theme.cpp | 6 ++++++ src/libsync/theme.h | 2 ++ 4 files changed, 16 insertions(+) diff --git a/src/gui/networksettings.cpp b/src/gui/networksettings.cpp index 6a21f0466..7c40850de 100644 --- a/src/gui/networksettings.cpp +++ b/src/gui/networksettings.cpp @@ -86,6 +86,11 @@ QSize NetworkSettings::sizeHint() const { void NetworkSettings::loadProxySettings() { + if (Theme::instance()->forceSystemNetworkProxy()) { + _ui->systemProxyRadioButton->setChecked(true); + _ui->proxyGroupBox->setEnabled(false); + return; + } // load current proxy settings OCC::ConfigFile cfgFile; int type = cfgFile.proxyType(); diff --git a/src/libsync/configfile.cpp b/src/libsync/configfile.cpp index 32d247570..3ed833c92 100644 --- a/src/libsync/configfile.cpp +++ b/src/libsync/configfile.cpp @@ -508,6 +508,9 @@ void ConfigFile::setValue(const QString& key, const QVariant &value) int ConfigFile::proxyType() const { + if (Theme::instance()->forceSystemNetworkProxy()) { + return QNetworkProxy::DefaultProxy; + } return getValue(QLatin1String(proxyTypeC)).toInt(); } diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index 1a80f4cac..ff2cce97a 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -427,6 +427,12 @@ bool Theme::userGroupSharing() const return true; } +bool Theme::forceSystemNetworkProxy() const +{ + return false; +} + + } // end namespace client diff --git a/src/libsync/theme.h b/src/libsync/theme.h index c86d848e4..d93fcb16d 100644 --- a/src/libsync/theme.h +++ b/src/libsync/theme.h @@ -237,6 +237,8 @@ public: virtual bool linkSharing() const; virtual bool userGroupSharing() const; + virtual bool forceSystemNetworkProxy() const; + protected: #ifndef TOKEN_AUTH_ONLY QIcon themeIcon(const QString& name, bool sysTray = false) const;