summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorXizhi Zhu <xizhi.zhu@nokia.com>2012-03-15 10:00:14 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-03-15 14:15:30 (GMT)
commite8c806793ad77ab8abe2bda855628257ec04b8b5 (patch)
tree7305c189a2f3bb0badded455ee192c1ab36f0d67 /src/network
parent1118f1cf0d74171f63c87635d3c0b53ea79a92dc (diff)
downloadQt-e8c806793ad77ab8abe2bda855628257ec04b8b5.zip
Qt-e8c806793ad77ab8abe2bda855628257ec04b8b5.tar.gz
Qt-e8c806793ad77ab8abe2bda855628257ec04b8b5.tar.bz2
Make sure QGlobalNetworkProxy is created for QNetworkProxy.
Otherwise, you don't have any socket engine handler created when directly setting a proxy to a socket. Cherry-picked from Qt5 / QtBase commit: 92659bacda53da782c84dff44d3caa2590dbc7cc Change-Id: Id87a13cf496553e85ca1f92f0cb5093752f3f5f5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/kernel/qnetworkproxy.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 4f294b9..7386093 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -423,6 +423,10 @@ template<> void QSharedDataPointer<QNetworkProxyPrivate>::detach()
QNetworkProxy::QNetworkProxy()
: d(0)
{
+ // make sure we have QGlobalNetworkProxy singleton created, otherwise
+ // you don't have any socket engine handler created when directly setting
+ // a proxy to the socket
+ globalNetworkProxy();
}
/*!
@@ -437,6 +441,10 @@ QNetworkProxy::QNetworkProxy(ProxyType type, const QString &hostName, quint16 po
const QString &user, const QString &password)
: d(new QNetworkProxyPrivate(type, hostName, port, user, password))
{
+ // make sure we have QGlobalNetworkProxy singleton created, otherwise
+ // you don't have any socket engine handler created when directly setting
+ // a proxy to a socket
+ globalNetworkProxy();
}
/*!