diff options
author | Kai Koehne <kai.koehne@qt.io> | 2017-07-20 16:14:47 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2017-07-25 09:00:08 +0000 |
commit | b5c8c48a87a19618b23d6d4fc5035915a9322117 (patch) | |
tree | 18fd975506d4872478a7d9a77d01559fedce9fcb /src/core/proxy_config_service_qt.h | |
parent | 9f947d40ad772068b2147aff4f4374dc8c0caf30 (diff) |
Fix logic to check for proxy settings
The previous code tried to find out whether a user has set an
application proxy by checking the type of the applicationProxy.
This is wrong, because a system proxy will actually also change the
applicationProxy type.
Instead, we now rely on QNetworkProxyFactory::usesSystemConfiguration
to decide whether to use QtNetwork's application proxy, or Chromium's
logic for the system proxy. We also save the state of
QNetworkProxy::useSystemConfiguration to be able to track changes.
[ChangeLog][Networking] Fixed an issue where system proxy settings were
not picked up correctly.
Task-number: QTBUG-61910
Change-Id: I1d9af3f6006ba187266fe50c645f425a46632e41
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'src/core/proxy_config_service_qt.h')
-rw-r--r-- | src/core/proxy_config_service_qt.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/proxy_config_service_qt.h b/src/core/proxy_config_service_qt.h index f2f9a2210..7be3289d0 100644 --- a/src/core/proxy_config_service_qt.h +++ b/src/core/proxy_config_service_qt.h @@ -69,13 +69,17 @@ private: void OnProxyConfigChanged(const net::ProxyConfig& config, ConfigAvailability availability) override; + // Retrieve new proxy settings and notify observers. + void Update(); + // Makes sure that the observer registration with the base service is set up. void RegisterObserver(); std::unique_ptr<net::ProxyConfigService> m_baseService; base::ObserverList<net::ProxyConfigService::Observer, true> m_observers; - // Keep the last QNetworkProxy::applicationProxy state around. + // Keep the last state around. + bool m_usesSystemConfiguration; QNetworkProxy m_qtApplicationProxy; net::ProxyConfig m_qtProxyConfig; |