mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 20:23:25 +00:00
Implement proxy re-configuration
- application level proxy is reconfigured on settings saving - tested with direct connection (no proxy), local proxy without auth (tinyproxy) and SOCKS (ssh -D dynamic port forwarding) - not sure about QNetworkProxy reuse between invocations - consider using QNetworkProxyFactory (but since no plain TCP connections are used, QNetworkProxy seems to be good choice) Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
9fca5a51d9
commit
5a98a221cc
1 changed files with 13 additions and 0 deletions
|
@ -51,6 +51,7 @@
|
||||||
#ifndef NO_USERMANUAL
|
#ifndef NO_USERMANUAL
|
||||||
#include "usermanual.h"
|
#include "usermanual.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include <QNetworkProxy>
|
||||||
|
|
||||||
MainWindow *MainWindow::m_Instance = NULL;
|
MainWindow *MainWindow::m_Instance = NULL;
|
||||||
|
|
||||||
|
@ -828,6 +829,18 @@ void MainWindow::readSettings()
|
||||||
default_dive_computer_product = getSetting(s, "dive_computer_product");
|
default_dive_computer_product = getSetting(s, "dive_computer_product");
|
||||||
default_dive_computer_device = getSetting(s, "dive_computer_device");
|
default_dive_computer_device = getSetting(s, "dive_computer_device");
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
|
||||||
loadRecentFiles(&s);
|
loadRecentFiles(&s);
|
||||||
checkSurvey(&s);
|
checkSurvey(&s);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue