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>
This commit is contained in:
Dirk Hohndel 2015-11-14 09:38:18 -08:00
parent 76d0763527
commit 97fa132202
4 changed files with 17 additions and 9 deletions

View file

@ -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");