From 833027906403ca0befcdd0e33554a5958791a945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Tue, 26 Apr 2011 08:35:04 +0000 Subject: [PATCH] proxy; refs #32 --- swisssurfer/src/main.cxx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/swisssurfer/src/main.cxx b/swisssurfer/src/main.cxx index 37ffd72..f1101a5 100644 --- a/swisssurfer/src/main.cxx +++ b/swisssurfer/src/main.cxx @@ -175,14 +175,18 @@ int main(int argv, char** argc) try { appTranslator.load(":/language/swisssurfer_"+ QLocale::system().name()); app.installTranslator(&appTranslator); //............................................................................ - QNetworkProxy::setApplicationProxy - (QNetworkProxy - ((env["PROXY_TYPE"]=="http" - ? QNetworkProxy::HttpProxy - : (env["PROXY_TYPE"]=="socks" - ? QNetworkProxy::Socks5Proxy - : QNetworkProxy::NoProxy)), - env["PROXY_HOST"], env["PROXY_PORT"].toInt())); + if (env["PROXY_TYPE"]=="http") + QNetworkProxy::setApplicationProxy + (QNetworkProxy + (QNetworkProxy::HttpProxy, + env["PROXY_HOST"], env["PROXY_PORT"].toInt())); + if (env["PROXY_TYPE"]=="socks") + QNetworkProxy::setApplicationProxy + (QNetworkProxy + (QNetworkProxy::Socks5Proxy, + env["PROXY_HOST"], env["PROXY_PORT"].toInt())); + else + QNetworkProxyFactory::setUseSystemConfiguration(true); qDebug()<<"***************************************************************"; qDebug()<<"Start - Proxy:" <<(QNetworkProxy::applicationProxy().type()==QNetworkProxy::NoProxy