summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-08-05 00:53:18 +0200
committerAndrea Diamantini <adjam7@gmail.com>2013-08-05 00:53:18 +0200
commit13ab976001d2e579ad302c95afc6ea65a61cb4ad (patch)
tree39d2d5ee19db074b611275d1e5f604a5cbc2dbfc /src
parentForce bookmarks saving on bookmarking all tabs (diff)
downloadrekonq-13ab976001d2e579ad302c95afc6ea65a61cb4ad.tar.xz
Fix support for http proxy in private mode
this patch is a tiny modification of the one provided by Pali Rohàr (thanks!!!). I just misunderstood it before and then forgot in my mail. Sorry for that, Pali. And thank you again :) CCMAIL: pali.rohar@gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/webtab/knetworkaccessmanager.cpp42
1 files changed, 33 insertions, 9 deletions
diff --git a/src/webtab/knetworkaccessmanager.cpp b/src/webtab/knetworkaccessmanager.cpp
index f02ec2d8..40b53933 100644
--- a/src/webtab/knetworkaccessmanager.cpp
+++ b/src/webtab/knetworkaccessmanager.cpp
@@ -51,21 +51,45 @@ KNetworkAccessManager::KNetworkAccessManager(QObject *parent)
kDebug() << "PROXY TYPE: " << proxyType;
if (proxyType == 0)
- proxy.setType(QNetworkProxy::NoProxy);
- else
- proxy.setType(QNetworkProxy::Socks5Proxy);
+ return;
+
+ QStringList httpProxy = proxyGroup.readEntry( QL1S("httpProxy"), QString("") ).split(QL1C(' '));
+ QStringList socksProxy = proxyGroup.readEntry( QL1S("socksProxy"), QString("") ).split(QL1C(' '));
+
+ QStringList proxyInfoList;
- QString proxyHost = proxyGroup.readEntry( QL1S("socksProxy"), QString("") );
- QStringList proxyInfoList = proxyHost.split(QL1C(' '));
- kDebug() << proxyInfoList;
+ if (!httpProxy.isEmpty())
+ {
+ proxy.setType(QNetworkProxy::HttpProxy);
+ proxyInfoList = httpProxy;
+ }
+ else
+ {
+ if (!socksProxy.isEmpty())
+ {
+ proxy.setType(QNetworkProxy::Socks5Proxy);
+ proxyInfoList = socksProxy;
+ }
+ }
+
if (proxyInfoList.isEmpty())
return;
- proxy.setHostName(proxyInfoList.at(0));
+ // else
+ proxyInfoList.first().remove("http://");
+
+ // set host
+ QString proxyHost = proxyInfoList.at(0);
+ kDebug() << "PROXY HOST: " << proxyHost;
+ proxy.setHostName(proxyHost);
+ // set port
if (proxyInfoList.count() == 2)
- proxy.setPort(proxyInfoList.at(1).toInt());
-
+ {
+ int proxyPort = proxyInfoList.at(1).toInt();
+ kDebug() << "PROXY PORT: " << proxyPort;
+ proxy.setPort(proxyPort);
+ }
// proxy.setUser("username");
// proxy.setPassword("password");
//