From 97fa1322025746d04813315992b7d87d6b782ce0 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 14 Nov 2015 09:38:18 -0800 Subject: Move proxy initialization into shared code This way we can use the same code on desktop and mobile app. Signed-off-by: Dirk Hohndel --- subsurface-mobile-helper.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'subsurface-mobile-helper.cpp') 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("org.subsurfacedivelog.mobile", 1, 0, "QMLManager"); -- cgit v1.2.3-70-g09d2