aboutsummaryrefslogtreecommitdiffstats
path: root/subsurface-core/qthelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'subsurface-core/qthelper.cpp')
-rw-r--r--subsurface-core/qthelper.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/subsurface-core/qthelper.cpp b/subsurface-core/qthelper.cpp
index c1205ce6f..091e714de 100644
--- a/subsurface-core/qthelper.cpp
+++ b/subsurface-core/qthelper.cpp
@@ -1678,3 +1678,16 @@ extern "C" bool in_planner()
{
return (currentApplicationState == "PlanDive" || currentApplicationState == "EditPlannedDive");
}
+
+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);
+}