summaryrefslogtreecommitdiff
path: root/src/networkaccessmanager.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-10-13 11:17:24 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-10-13 11:17:24 +0200
commit363147061d4aa8146008d4363ee8f583cf3e88dc (patch)
treebe75932223aa81b7aced8bb4b082b2e689d06d5f /src/networkaccessmanager.cpp
parentcosmetic... (diff)
parentSmall fixes (const issue, single char issue, file not ending with a new line)... (diff)
downloadrekonq-363147061d4aa8146008d4363ee8f583cf3e88dc.tar.xz
Merge commit 'refs/merge-requests/1772' of git://gitorious.org/rekonq/mainline into proxy
Diffstat (limited to 'src/networkaccessmanager.cpp')
-rw-r--r--src/networkaccessmanager.cpp39
1 files changed, 24 insertions, 15 deletions
diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp
index fd975062..1cdc6700 100644
--- a/src/networkaccessmanager.cpp
+++ b/src/networkaccessmanager.cpp
@@ -42,6 +42,7 @@
// KDE Includes
#include <KMessageBox>
#include <KStandardDirs>
+#include <KProtocolManager>
// Qt Includes
#include <QtCore/QPointer>
@@ -69,7 +70,7 @@ NetworkAccessManager::NetworkAccessManager(QObject *parent)
// load AccessManager Settings
loadSettings();
-
+
// resetting disk cache
resetDiskCache();
}
@@ -77,23 +78,31 @@ NetworkAccessManager::NetworkAccessManager(QObject *parent)
void NetworkAccessManager::loadSettings()
{
- if (ReKonfig::isProxyEnabled())
+ // Grab proxy settings from KDE settings
+ if (KProtocolManager::useProxy())
{
- QNetworkProxy proxy;
- if (ReKonfig::proxyType() == 0)
- {
- proxy.setType(QNetworkProxy::Socks5Proxy);
- }
- else
+ QString proxyAddress = KProtocolManager::proxyFor("http");
+
+ if(!proxyAddress.isEmpty())
{
- proxy.setType(QNetworkProxy::HttpProxy);
+ KUrl proxyUrl(proxyAddress);
+ QNetworkProxy::ProxyType proxyType = QNetworkProxy::NoProxy;
+
+ // See what kind of proxy we have here
+ if(proxyUrl.protocol() == "socks")
+ {
+ proxyType = QNetworkProxy::Socks5Proxy;
+ }
+ else
+ {
+ proxyType = QNetworkProxy::HttpProxy;
+ }
+
+ QNetworkProxy proxy(proxyType, proxyUrl.host(), (quint16)proxyUrl.port(),
+ proxyUrl.user(), proxyUrl.pass());
+
+ setProxy(proxy);
}
- proxy.setHostName(ReKonfig::proxyHostName());
- proxy.setPort(ReKonfig::proxyPort());
- proxy.setUser(ReKonfig::proxyUserName());
- proxy.setPassword(ReKonfig::proxyPassword());
-
- setProxy(proxy);
}
}