From 28d3d82a0d2f0fe8e4784a17a167c2f9f2e2420e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Thu, 12 Mar 2020 10:47:21 +0100 Subject: [PATCH] QtNetwork deprecations: suppress internal warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There're some uses we can't get rid of until the deprecated functions are deleted, so suppress them for now. Change-Id: I85b737eefc71f8f3ac939dfa961383220a8244af Reviewed-by: Tor Arne Vestbø --- src/network/access/qnetworkaccessmanager.cpp | 2 ++ src/network/access/qnetworkaccessmanager.h | 2 +- src/network/access/qnetworkreply.cpp | 2 ++ src/network/access/qnetworkreply.h | 2 +- src/network/kernel/qtnetworkglobal.h | 4 ++++ src/network/kernel/qtnetworkglobal_p.h | 11 +++++++++++ src/network/socket/qabstractsocket.cpp | 2 ++ src/network/socket/qabstractsocket.h | 2 +- src/network/socket/qlocalsocket.cpp | 2 ++ src/network/socket/qlocalsocket.h | 2 +- 10 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index a8cf983ec9..e7e6e6b1a4 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -37,6 +37,8 @@ ** ****************************************************************************/ +#include + #include "qnetworkaccessmanager.h" #include "qnetworkaccessmanager_p.h" #include "qnetworkrequest.h" diff --git a/src/network/access/qnetworkaccessmanager.h b/src/network/access/qnetworkaccessmanager.h index 12c7a7cea1..6f7f90ce14 100644 --- a/src/network/access/qnetworkaccessmanager.h +++ b/src/network/access/qnetworkaccessmanager.h @@ -92,7 +92,7 @@ public: }; #ifndef QT_NO_BEARERMANAGEMENT // ### Qt6: Remove section - enum QT_DEPRECATED_VERSION_5_15 NetworkAccessibility { + enum QT_DEPRECATED_NETWORK_API_5_15 NetworkAccessibility { UnknownAccessibility = -1, NotAccessible = 0, Accessible = 1 diff --git a/src/network/access/qnetworkreply.cpp b/src/network/access/qnetworkreply.cpp index 22c522756c..6784bc734d 100644 --- a/src/network/access/qnetworkreply.cpp +++ b/src/network/access/qnetworkreply.cpp @@ -37,6 +37,8 @@ ** ****************************************************************************/ +#include + #include "qnetworkreply.h" #include "qnetworkreply_p.h" #include diff --git a/src/network/access/qnetworkreply.h b/src/network/access/qnetworkreply.h index 82349f9e2a..c7d981c97e 100644 --- a/src/network/access/qnetworkreply.h +++ b/src/network/access/qnetworkreply.h @@ -157,7 +157,7 @@ Q_SIGNALS: void metaDataChanged(); void finished(); #if QT_DEPRECATED_SINCE(5,15) - QT_DEPRECATED_X("Use QNetworkReply::errorOccurred(QNetworkReply::NetworkError) instead") + QT_DEPRECATED_NETWORK_API_5_15_X("Use QNetworkReply::errorOccurred(QNetworkReply::NetworkError) instead") void error(QNetworkReply::NetworkError); #endif void errorOccurred(QNetworkReply::NetworkError); diff --git a/src/network/kernel/qtnetworkglobal.h b/src/network/kernel/qtnetworkglobal.h index 1a931cefa4..b0adc9f68c 100644 --- a/src/network/kernel/qtnetworkglobal.h +++ b/src/network/kernel/qtnetworkglobal.h @@ -64,6 +64,10 @@ QT_BEGIN_NAMESPACE #define QT_DEPRECATED_BEARER_MANAGEMENT QT_DEPRECATED_VERSION_5_15 #endif +// ### Qt6: Remove +#define QT_DEPRECATED_NETWORK_API_5_15 QT_DEPRECATED_VERSION_5_15 +#define QT_DEPRECATED_NETWORK_API_5_15_X QT_DEPRECATED_VERSION_X_5_15 + QT_END_NAMESPACE #endif diff --git a/src/network/kernel/qtnetworkglobal_p.h b/src/network/kernel/qtnetworkglobal_p.h index 1d5a417f94..10bc37c85e 100644 --- a/src/network/kernel/qtnetworkglobal_p.h +++ b/src/network/kernel/qtnetworkglobal_p.h @@ -61,4 +61,15 @@ #endif #define QT_DEPRECATED_BEARER_MANAGEMENT +// ### Qt6: Remove +#ifdef QT_DEPRECATED_NETWORK_API_5_15 +#undef QT_DEPRECATED_NETWORK_API_5_15 +#endif +#define QT_DEPRECATED_NETWORK_API_5_15 + +#ifdef QT_DEPRECATED_NETWORK_API_5_15_X +#undef QT_DEPRECATED_NETWORK_API_5_15_X +#endif +#define QT_DEPRECATED_NETWORK_API_5_15_X(x) + #endif // QTNETWORKGLOBAL_P_H diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index fb792e428f..fa85f48ad5 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -469,6 +469,8 @@ SSL error notification. I.E. QSslSocket::sslErrors(). */ +#include + #include "qabstractsocket.h" #include "qabstractsocket_p.h" diff --git a/src/network/socket/qabstractsocket.h b/src/network/socket/qabstractsocket.h index 1482dcaab2..46d25d5677 100644 --- a/src/network/socket/qabstractsocket.h +++ b/src/network/socket/qabstractsocket.h @@ -207,7 +207,7 @@ Q_SIGNALS: void disconnected(); void stateChanged(QAbstractSocket::SocketState); #if QT_DEPRECATED_SINCE(5,15) - QT_DEPRECATED_X("Use QAbstractSocket::errorOccurred(QAbstractSocket::SocketError) instead") + QT_DEPRECATED_NETWORK_API_5_15_X("Use QAbstractSocket::errorOccurred(QAbstractSocket::SocketError) instead") void error(QAbstractSocket::SocketError); #endif void errorOccurred(QAbstractSocket::SocketError); diff --git a/src/network/socket/qlocalsocket.cpp b/src/network/socket/qlocalsocket.cpp index 18f400fe0b..94bbb17412 100644 --- a/src/network/socket/qlocalsocket.cpp +++ b/src/network/socket/qlocalsocket.cpp @@ -37,6 +37,8 @@ ** ****************************************************************************/ +#include + #include "qlocalsocket.h" #include "qlocalsocket_p.h" diff --git a/src/network/socket/qlocalsocket.h b/src/network/socket/qlocalsocket.h index 9cd62abca6..200d59a309 100644 --- a/src/network/socket/qlocalsocket.h +++ b/src/network/socket/qlocalsocket.h @@ -118,7 +118,7 @@ Q_SIGNALS: void connected(); void disconnected(); #if QT_DEPRECATED_SINCE(5,15) - QT_DEPRECATED_X("Use QLocalSocket::errorOccurred(QLocalSocket::LocalSocketError) instead") + QT_DEPRECATED_NETWORK_API_5_15_X("Use QLocalSocket::errorOccurred(QLocalSocket::LocalSocketError) instead") void error(QLocalSocket::LocalSocketError socketError); #endif void errorOccurred(QLocalSocket::LocalSocketError socketError);