summaryrefslogtreecommitdiffstats
path: root/subsurface-mobile-helper.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-14 09:38:18 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-14 09:39:02 -0800
commit97fa1322025746d04813315992b7d87d6b782ce0 (patch)
tree1153c3258828a1ba3c90bca77b5751ca9e5c60c9 /subsurface-mobile-helper.cpp
parent76d07635270bb3068b7d9a559b481d3c094f0d7b (diff)
downloadsubsurface-97fa1322025746d04813315992b7d87d6b782ce0.tar.gz
Move proxy initialization into shared code
This way we can use the same code on desktop and mobile app. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-mobile-helper.cpp')
-rw-r--r--subsurface-mobile-helper.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp
index f7eaca10f..170317100 100644
--- a/subsurface-mobile-helper.cpp
+++ b/subsurface-mobile-helper.cpp
@@ -27,6 +27,19 @@ void init_ui()
init_qt_late();
}
+void init_proxy()
+{
+ QNetworkProxy proxy;
+ proxy.setType(QNetworkProxy::ProxyType(prefs.proxy_type));
+ proxy.setHostName(prefs.proxy_host);
+ proxy.setPort(prefs.proxy_port);
+ if (prefs.proxy_auth) {
+ proxy.setUser(prefs.proxy_user);
+ proxy.setPassword(prefs.proxy_pass);
+ }
+ QNetworkProxy::setApplicationProxy(proxy);
+}
+
void run_ui()
{
qmlRegisterType<QMLManager>("org.subsurfacedivelog.mobile", 1, 0, "QMLManager");