, socks5SocketEngineHandler(0)
, httpSocketEngineHandler(0)
{
+#ifndef QT_NO_SOCKS5
+ socks5SocketEngineHandler = new QSocks5SocketEngineHandler();
+#endif
+#ifndef QT_NO_HTTP
+ httpSocketEngineHandler = new QHttpSocketEngineHandler();
+#endif
}
~QGlobalNetworkProxy()
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);
QNetworkProxy::QNetworkProxy()
: d(0)
{
- if (QGlobalNetworkProxy *globalProxy = globalNetworkProxy())
- globalProxy->init();
}
/*!
const QString &user, const QString &password)
: d(new QNetworkProxyPrivate(type, hostName, port, user, password))
{
- if (QGlobalNetworkProxy *globalProxy = globalNetworkProxy())
- globalProxy->init();
}
/*!