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.

Change-Id: I35cd7f52331672a6d3e7bcdf817c0fe1fd1e7de3
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
This commit is contained in:
Xizhi Zhu 2012-03-15 10:26:39 +01:00 committed by Qt by Nokia
parent e8a7e926cf
commit 92659bacda

View File

@ -426,6 +426,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 a socket
globalNetworkProxy();
}
/*!
@ -440,6 +444,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();
}
/*!