diff options
-rw-r--r-- | src/network/kernel/qnetworkproxy.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp index 288cab9..4f294b9 100644 --- a/src/network/kernel/qnetworkproxy.cpp +++ b/src/network/kernel/qnetworkproxy.cpp @@ -247,6 +247,12 @@ public: , socks5SocketEngineHandler(0) , httpSocketEngineHandler(0) { +#ifndef QT_NO_SOCKS5 + socks5SocketEngineHandler = new QSocks5SocketEngineHandler(); +#endif +#ifndef QT_NO_HTTP + httpSocketEngineHandler = new QHttpSocketEngineHandler(); +#endif } ~QGlobalNetworkProxy() @@ -257,19 +263,6 @@ public: delete httpSocketEngineHandler; } - void init() - { - QMutexLocker lock(&mutex); -#ifndef QT_NO_SOCKS5 - if (!socks5SocketEngineHandler) - socks5SocketEngineHandler = new QSocks5SocketEngineHandler(); -#endif -#ifndef QT_NO_HTTP - if (!httpSocketEngineHandler) - httpSocketEngineHandler = new QHttpSocketEngineHandler(); -#endif - } - void setApplicationProxy(const QNetworkProxy &proxy) { QMutexLocker lock(&mutex); @@ -430,8 +423,6 @@ template<> void QSharedDataPointer<QNetworkProxyPrivate>::detach() QNetworkProxy::QNetworkProxy() : d(0) { - if (QGlobalNetworkProxy *globalProxy = globalNetworkProxy()) - globalProxy->init(); } /*! @@ -446,8 +437,6 @@ QNetworkProxy::QNetworkProxy(ProxyType type, const QString &hostName, quint16 po const QString &user, const QString &password) : d(new QNetworkProxyPrivate(type, hostName, port, user, password)) { - if (QGlobalNetworkProxy *globalProxy = globalNetworkProxy()) - globalProxy->init(); } /*! |