mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
76d0763527
commit
97fa132202
4 changed files with 17 additions and 9 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue