Convert features.socks5 to QT_[REQUIRE_]CONFIG

The sources were already added conditionally in the project file since
179fe5981fa.

Change-Id: I0baaec2e772f3e596d311c1973b9745aa2b80423
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Stephan Binner 2017-09-04 21:52:30 +02:00
parent 029e5cde33
commit c6b9c6e5f2
6 changed files with 15 additions and 18 deletions

View File

@ -227,7 +227,9 @@
#ifndef QT_NO_NETWORKPROXY
#include "private/qnetworkrequest_p.h"
#if QT_CONFIG(socks5)
#include "private/qsocks5socketengine_p.h"
#endif
#include "private/qhttpsocketengine_p.h"
#include "qauthenticator.h"
#include "qdebug.h"
@ -251,7 +253,7 @@ public:
: mutex(QMutex::Recursive)
, applicationLevelProxy(0)
, applicationLevelProxyFactory(0)
#ifndef QT_NO_SOCKS5
#if QT_CONFIG(socks5)
, socks5SocketEngineHandler(0)
#endif
#ifndef QT_NO_HTTP
@ -263,7 +265,7 @@ public:
, useSystemProxies(false)
#endif
{
#ifndef QT_NO_SOCKS5
#if QT_CONFIG(socks5)
socks5SocketEngineHandler = new QSocks5SocketEngineHandler();
#endif
#ifndef QT_NO_HTTP
@ -275,7 +277,7 @@ public:
{
delete applicationLevelProxy;
delete applicationLevelProxyFactory;
#ifndef QT_NO_SOCKS5
#if QT_CONFIG(socks5)
delete socks5SocketEngineHandler;
#endif
#ifndef QT_NO_HTTP
@ -335,7 +337,7 @@ private:
QMutex mutex;
QNetworkProxy *applicationLevelProxy;
QNetworkProxyFactory *applicationLevelProxyFactory;
#ifndef QT_NO_SOCKS5
#if QT_CONFIG(socks5)
QSocks5SocketEngineHandler *socks5SocketEngineHandler;
#endif
#ifndef QT_NO_HTTP

View File

@ -39,8 +39,6 @@
#include "qsocks5socketengine_p.h"
#ifndef QT_NO_SOCKS5
#include "qtcpsocket.h"
#include "qudpsocket.h"
#include "qtcpserver.h"
@ -1938,6 +1936,4 @@ QAbstractSocketEngine *QSocks5SocketEngineHandler::createSocketEngine(qintptr so
return 0;
}
#endif // QT_NO_SOCKS5
QT_END_NAMESPACE

View File

@ -55,9 +55,9 @@
#include "qabstractsocketengine_p.h"
#include "qnetworkproxy.h"
QT_BEGIN_NAMESPACE
QT_REQUIRE_CONFIG(socks5);
#ifndef QT_NO_SOCKS5
QT_BEGIN_NAMESPACE
class QSocks5SocketEnginePrivate;
@ -291,7 +291,6 @@ public:
virtual QAbstractSocketEngine *createSocketEngine(qintptr socketDescriptor, QObject *parent) Q_DECL_OVERRIDE;
};
QT_END_NAMESPACE
#endif // QT_NO_SOCKS5
#endif // QSOCKS5SOCKETENGINE_H

View File

@ -186,7 +186,7 @@ void tst_QFtp::initTestCase_data()
QTest::addColumn<bool>("setSession");
QTest::newRow("WithoutProxy") << false << 0 << false;
#ifndef QT_NO_SOCKS5
#if QT_CONFIG(socks5)
QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy) << false;
#endif
//### doesn't work well yet.
@ -194,7 +194,7 @@ void tst_QFtp::initTestCase_data()
#ifndef QT_NO_BEARERMANAGEMENT
QTest::newRow("WithoutProxyWithSession") << false << 0 << true;
#ifndef QT_NO_SOCKS5
#if QT_CONFIG(socks5)
QTest::newRow("WithSocks5ProxyAndSession") << true << int(QNetworkProxy::Socks5Proxy) << true;
#endif
#endif

View File

@ -149,7 +149,7 @@ void tst_QTcpServer::initTestCase_data()
QTest::addColumn<int>("proxyType");
QTest::newRow("WithoutProxy") << false << 0;
#ifndef QT_NO_SOCKS5
#if QT_CONFIG(socks5)
QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy);
#endif

View File

@ -205,7 +205,7 @@ void tst_QUdpSocket::initTestCase_data()
QTest::addColumn<int>("proxyType");
QTest::newRow("WithoutProxy") << false << 0;
#ifndef QT_NO_SOCKS5
#if QT_CONFIG(socks5)
if (!newTestServer)
QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy);
#endif
@ -233,14 +233,14 @@ void tst_QUdpSocket::init()
{
QFETCH_GLOBAL(bool, setProxy);
if (setProxy) {
#ifndef QT_NO_SOCKS5
#if QT_CONFIG(socks5)
QFETCH_GLOBAL(int, proxyType);
if (proxyType == QNetworkProxy::Socks5Proxy) {
QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080));
}
#else
QSKIP("No proxy support");
#endif // !QT_NO_SOCKS5
#endif // QT_CONFIG(socks5)
}
}