diff options
Diffstat (limited to 'src/network/kernel/qnetworkproxy.cpp')
-rw-r--r-- | src/network/kernel/qnetworkproxy.cpp | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp index 0ed68042f6..3646a9526a 100644 --- a/src/network/kernel/qnetworkproxy.cpp +++ b/src/network/kernel/qnetworkproxy.cpp @@ -230,7 +230,11 @@ #if QT_CONFIG(socks5) #include "private/qsocks5socketengine_p.h" #endif + +#if QT_CONFIG(http) #include "private/qhttpsocketengine_p.h" +#endif + #include "qauthenticator.h" #include "qdebug.h" #include "qmutex.h" @@ -256,7 +260,7 @@ public: #if QT_CONFIG(socks5) , socks5SocketEngineHandler(0) #endif -#ifndef QT_NO_HTTP +#if QT_CONFIG(http) , httpSocketEngineHandler(0) #endif #ifdef QT_USE_SYSTEM_PROXIES @@ -268,7 +272,7 @@ public: #if QT_CONFIG(socks5) socks5SocketEngineHandler = new QSocks5SocketEngineHandler(); #endif -#ifndef QT_NO_HTTP +#if QT_CONFIG(http) httpSocketEngineHandler = new QHttpSocketEngineHandler(); #endif } @@ -280,7 +284,7 @@ public: #if QT_CONFIG(socks5) delete socks5SocketEngineHandler; #endif -#ifndef QT_NO_HTTP +#if QT_CONFIG(http) delete httpSocketEngineHandler; #endif } @@ -340,7 +344,7 @@ private: #if QT_CONFIG(socks5) QSocks5SocketEngineHandler *socks5SocketEngineHandler; #endif -#ifndef QT_NO_HTTP +#if QT_CONFIG(http) QHttpSocketEngineHandler *httpSocketEngineHandler; #endif bool useSystemProxies; @@ -917,9 +921,6 @@ public: QUrl remote; int localPort; QNetworkProxyQuery::QueryType type; -#ifndef QT_NO_BEARERMANAGEMENT - QNetworkConfiguration config; -#endif }; template<> void QSharedDataPointer<QNetworkProxyQueryPrivate>::detach() @@ -1131,29 +1132,32 @@ QNetworkProxyQuery::QNetworkProxyQuery(quint16 bindPort, const QString &protocol d->type = queryType; } -#ifndef QT_NO_BEARERMANAGEMENT +#if !defined(QT_NO_BEARERMANAGEMENT) && QT_DEPRECATED_SINCE(5, 10) /*! + \deprecated + Constructs a QNetworkProxyQuery with the URL \a requestUrl and sets the query type to \a queryType. The specified \a networkConfiguration - is used to resolve the proxy settings. + parameter is ignored. \sa protocolTag(), peerHostName(), peerPort(), networkConfiguration() */ QNetworkProxyQuery::QNetworkProxyQuery(const QNetworkConfiguration &networkConfiguration, const QUrl &requestUrl, QueryType queryType) { - d->config = networkConfiguration; + Q_UNUSED(networkConfiguration) d->remote = requestUrl; d->type = queryType; } /*! + \deprecated + Constructs a QNetworkProxyQuery of type \a queryType and sets the protocol tag to be \a protocolTag. This constructor is suitable for QNetworkProxyQuery::TcpSocket queries, because it sets the peer hostname to \a hostname and the peer's port number to \a - port. The specified \a networkConfiguration - is used to resolve the proxy settings. + port. The specified \a networkConfiguration parameter is ignored. \sa networkConfiguration() */ @@ -1162,7 +1166,7 @@ QNetworkProxyQuery::QNetworkProxyQuery(const QNetworkConfiguration &networkConfi const QString &protocolTag, QueryType queryType) { - d->config = networkConfiguration; + Q_UNUSED(networkConfiguration); d->remote.setScheme(protocolTag); d->remote.setHost(hostname); d->remote.setPort(port); @@ -1170,11 +1174,13 @@ QNetworkProxyQuery::QNetworkProxyQuery(const QNetworkConfiguration &networkConfi } /*! + \deprecated + Constructs a QNetworkProxyQuery of type \a queryType and sets the protocol tag to be \a protocolTag. This constructor is suitable for QNetworkProxyQuery::TcpSocket queries because it sets the local port number to \a bindPort. The specified \a networkConfiguration - is used to resolve the proxy settings. + parameter is ignored. Note that \a bindPort is of type quint16 to indicate the exact port number that is requested. The value of -1 (unknown) is not @@ -1186,12 +1192,12 @@ QNetworkProxyQuery::QNetworkProxyQuery(const QNetworkConfiguration &networkConfi quint16 bindPort, const QString &protocolTag, QueryType queryType) { - d->config = networkConfiguration; + Q_UNUSED(networkConfiguration); d->remote.setScheme(protocolTag); d->localPort = bindPort; d->type = queryType; } -#endif +#endif // !defined(QT_NO_BEARERMANAGEMENT) && QT_DEPRECATED_SINCE(5, 10) /*! Constructs a QNetworkProxyQuery object that is a copy of \a other. @@ -1415,34 +1421,32 @@ void QNetworkProxyQuery::setUrl(const QUrl &url) d->remote = url; } -#ifndef QT_NO_BEARERMANAGEMENT +#if !defined(QT_NO_BEARERMANAGEMENT) && QT_DEPRECATED_SINCE(5, 10) /*! - Returns the network configuration component of the query. + \deprecated + + Returns QNetworkConfiguration(). \sa setNetworkConfiguration() */ QNetworkConfiguration QNetworkProxyQuery::networkConfiguration() const { - return d ? d->config : QNetworkConfiguration(); + return QNetworkConfiguration(); } /*! - Sets the network configuration component of this QNetworkProxyQuery - object to be \a networkConfiguration. The network configuration can - be used to return different proxy settings based on the network in - use, for example WLAN vs cellular networks on a mobile phone. + \deprecated - In the case of "user choice" or "service network" configurations, - you should first start the QNetworkSession and obtain the active - configuration from its properties. + This function does nothing. The specified \a networkConfiguration parameter + is ignored. \sa networkConfiguration() */ void QNetworkProxyQuery::setNetworkConfiguration(const QNetworkConfiguration &networkConfiguration) { - d->config = networkConfiguration; + Q_UNUSED(networkConfiguration); } -#endif +#endif // !defined(QT_NO_BEARERMANAGEMENT) && QT_DEPRECATED_SINCE(5, 10) /*! \class QNetworkProxyFactory |