summaryrefslogtreecommitdiffstats
path: root/qt-gui.cpp
diff options
context:
space:
mode:
authorGravatar Thiago Macieira <thiago@macieira.org>2013-07-13 14:42:26 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-07-18 12:00:12 -0700
commit4f49a69d7db9f26dea52c8effafba1f63261aa98 (patch)
treede01cd86f8671c035a9b34e705d6d4f903851fb3 /qt-gui.cpp
parentf470f559d12d320588170307233d6a68f8a52e2b (diff)
downloadsubsurface-4f49a69d7db9f26dea52c8effafba1f63261aa98.tar.gz
Ask Qt to use system proxies in Subsurface
This causes the Marble widget to use proxies automatically too. On Mac, this gets the global proxy settings; on Windows, it gets the IE settings; on Unix, it uses environment variables (set http_proxy and all_proxy). Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-gui.cpp')
-rw-r--r--qt-gui.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/qt-gui.cpp b/qt-gui.cpp
index eab282dc0..f955809d6 100644
--- a/qt-gui.cpp
+++ b/qt-gui.cpp
@@ -35,6 +35,7 @@
#include <QDebug>
#include <QMap>
#include <QMultiMap>
+#include <QNetworkProxy>
const char *default_dive_computer_vendor;
const char *default_dive_computer_product;
@@ -97,6 +98,10 @@ void init_ui(int *argcp, char ***argvp)
application = new QApplication(*argcp, *argvp);
+ // tell Qt to use system proxies
+ // note: on Linux, "system" == "environment variables"
+ QNetworkProxyFactory::setUseSystemConfiguration(true);
+
// the Gtk theme makes things unbearably ugly
// so switch to Oxygen in this case
if (application->style()->objectName() == "gtk+")