diff ui/downloader.cpp @ 1062:515345358b71

(issue41) Add and use a UseProxy checkbox Using proxy no longer depends on the proxyUrl beeing empty but rather on the value of the checkbox.
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 10 Sep 2014 11:06:49 +0200
parents 2949f1842955
children 508c96e72f62
line wrap: on
line diff
--- a/ui/downloader.cpp	Wed Sep 10 11:05:34 2014 +0200
+++ b/ui/downloader.cpp	Wed Sep 10 11:06:49 2014 +0200
@@ -74,13 +74,14 @@
 /* Set up Proxy support. */
     QSettings settings;
     QString settingsProxy = settings.value("ProxyURL").toString();
-    if (settingsProxy.isEmpty()) {
+    bool useProxy = settings.value("UseProxy", false).toBool();
+    if (useProxy && settingsProxy.isEmpty()) {
         QByteArray envProxy = qgetenv("http_proxy");
         if (envProxy.size()) {
             settingsProxy = QString::fromLocal8Bit(envProxy);
         }
     }
-    if (!settingsProxy.isEmpty()) {
+    if (useProxy && !settingsProxy.isEmpty()) {
         mSSLConnection->setProxy(QUrl(settingsProxy));
     }
 #else

http://wald.intevation.org/projects/trustbridge/