diff ui/downloader.cpp @ 978:d92b1594e974

Merged.
author Emanuel Schuetze <emanuel@intevation.de>
date Fri, 29 Aug 2014 13:10:11 +0200
parents 879a634d0a40
children 2949f1842955
line wrap: on
line diff
--- a/ui/downloader.cpp	Fri Aug 29 13:09:40 2014 +0200
+++ b/ui/downloader.cpp	Fri Aug 29 13:10:11 2014 +0200
@@ -17,6 +17,7 @@
 #include <QStandardPaths>
 #include <QLocale>
 #include <QSaveFile>
+#include <QSettings>
 
 #include <polarssl/net.h>
 #include <polarssl/ssl.h>
@@ -50,6 +51,18 @@
 {
 #ifdef USE_CURL
     mSSLConnection = new SSLConnectionCurl(url, certificate);
+/* Set up Proxy support. */
+    QSettings settings;
+    QString settingsProxy = settings.value("ProxyURL").toString();
+    if (settingsProxy.isEmpty()) {
+        QByteArray envProxy = qgetenv("http_proxy");
+        if (envProxy.size()) {
+            settingsProxy = QString::fromLocal8Bit(envProxy);
+        }
+    }
+    if (!settingsProxy.isEmpty()) {
+        mSSLConnection->setProxy(QUrl(settingsProxy));
+    }
 #else
     mSSLConnection = new SSLConnectionBare(url, certificate);
 #endif

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