From 7dd7fe94c642cce4c9db88a06cf71ebe405d5a08 Mon Sep 17 00:00:00 2001 From: nowrep Date: Sat, 1 Jun 2013 13:01:26 +0200 Subject: [PATCH] [NetworkIcon] Fixed applying selected proxy. --- CHANGELOG | 1 + src/lib/network/networkproxyfactory.cpp | 3 +++ src/plugins/StatusBarIcons/sbi_networkmanager.cpp | 1 + src/plugins/StatusBarIcons/sbi_networkproxy.cpp | 10 ++++++++++ src/plugins/StatusBarIcons/sbi_networkproxy.h | 2 +- src/plugins/StatusBarIcons/sbi_proxywidget.cpp | 9 ++++++--- 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index bcf52939c..5d4a7aeca 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,7 @@ Version 1.5.0 * added KWallet password backend plugin * added Gnome-Keyring password backend plugin * added StatusBar Icons plugin that adds extra icons to statusbar + * pagescreen can now save output into number of formats, including PDF * proxy exceptions now supports wildcards (*, ?) * cancel upload when trying to upload non-readable files * GreaseMonkey: added support for GM_Settings diff --git a/src/lib/network/networkproxyfactory.cpp b/src/lib/network/networkproxyfactory.cpp index afa66d156..abbeccc2d 100644 --- a/src/lib/network/networkproxyfactory.cpp +++ b/src/lib/network/networkproxyfactory.cpp @@ -64,6 +64,9 @@ NetworkProxyFactory::NetworkProxyFactory() : QNetworkProxyFactory() , m_pacManager(new PacManager) , m_proxyPreference(SystemProxy) + , m_proxyType(QNetworkProxy::HttpProxy) + , m_port(0) + , m_httpsPort(0) { } diff --git a/src/plugins/StatusBarIcons/sbi_networkmanager.cpp b/src/plugins/StatusBarIcons/sbi_networkmanager.cpp index d57726119..ff2cf8978 100644 --- a/src/plugins/StatusBarIcons/sbi_networkmanager.cpp +++ b/src/plugins/StatusBarIcons/sbi_networkmanager.cpp @@ -126,6 +126,7 @@ void SBI_NetworkManager::applyCurrentProxy() settings.beginGroup("Web-Proxy"); m_currentProxy->saveToSettings(settings); settings.endGroup(); + settings.sync(); mApp->networkManager()->proxyFactory()->loadSettings(); } diff --git a/src/plugins/StatusBarIcons/sbi_networkproxy.cpp b/src/plugins/StatusBarIcons/sbi_networkproxy.cpp index 681834f25..60084b2c4 100644 --- a/src/plugins/StatusBarIcons/sbi_networkproxy.cpp +++ b/src/plugins/StatusBarIcons/sbi_networkproxy.cpp @@ -118,6 +118,16 @@ void SBI_NetworkProxy::setHttpsPassword(const QString &password) m_httpsPassword = password; } +QUrl SBI_NetworkProxy::proxyAutoConfigUrl() const +{ + return m_pacUrl; +} + +void SBI_NetworkProxy::setProxyAutoConfigUrl(const QUrl &url) +{ + m_pacUrl = url; +} + bool SBI_NetworkProxy::useDifferentProxyForHttps() const { return m_useDifferentProxyForHttps; diff --git a/src/plugins/StatusBarIcons/sbi_networkproxy.h b/src/plugins/StatusBarIcons/sbi_networkproxy.h index 0e076e3e8..7f2f78062 100644 --- a/src/plugins/StatusBarIcons/sbi_networkproxy.h +++ b/src/plugins/StatusBarIcons/sbi_networkproxy.h @@ -56,7 +56,7 @@ public: void setHttpsPassword(const QString &password); QUrl proxyAutoConfigUrl() const; - void setProxyAutoConfigUrl(); + void setProxyAutoConfigUrl(const QUrl &url); bool useDifferentProxyForHttps() const; void setUseDifferentProxyForHttps(bool use); diff --git a/src/plugins/StatusBarIcons/sbi_proxywidget.cpp b/src/plugins/StatusBarIcons/sbi_proxywidget.cpp index f676ec307..b225d0f73 100644 --- a/src/plugins/StatusBarIcons/sbi_proxywidget.cpp +++ b/src/plugins/StatusBarIcons/sbi_proxywidget.cpp @@ -25,10 +25,11 @@ void SBI_ProxyWidget::clear() ui->httpsProxyUsername->clear(); ui->httpsProxyPassword->clear(); - ui->useHttpsProxy->setChecked(false); ui->proxyExceptions->clear(); - ui->proxyType->setCurrentIndex(0); + ui->pacUrl->clear(); + ui->proxyType->setCurrentIndex(0); + ui->useHttpsProxy->setChecked(false); ui->noProxy->setChecked(true); } @@ -46,8 +47,10 @@ SBI_NetworkProxy* SBI_ProxyWidget::getProxy() const proxy->setHttpsUserName(ui->httpsProxyUsername->text()); proxy->setHttpsPassword(ui->httpsProxyPassword->text()); + proxy->setExceptions(ui->proxyExceptions->text().split(QLatin1Char(','), QString::SkipEmptyParts)); + proxy->setProxyAutoConfigUrl(QUrl(ui->pacUrl->text())); + proxy->setUseDifferentProxyForHttps(ui->useHttpsProxy->isChecked()); - proxy->setExceptions(ui->proxyExceptions->text().split(QLatin1Char(','))); proxy->setType(ui->proxyType->currentIndex() == 0 ? QNetworkProxy::HttpProxy : QNetworkProxy::Socks5Proxy); if (ui->noProxy->isChecked()) {