AusweisApp2/patches/qt-Add-debug-stream-operato...

81 lines
2.6 KiB
Diff

From a65c1ef2833757f49024f13900645abf62d6eb22 Mon Sep 17 00:00:00 2001
From: Lars Schmertmann <Lars.Schmertmann@governikus.de>
Date: Tue, 10 Jan 2017 08:52:35 +0100
Subject: Add debug stream operator for QNetworkProxyQuery
Change-Id: Iae215827350e47a8ce31e5828d3ad1ed54564e84
---
src/network/kernel/qnetworkproxy.cpp | 19 +++++++++++++++----
src/network/kernel/qnetworkproxy.h | 4 ++++
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git x/qtbase/src/network/kernel/qnetworkproxy.cpp y/qtbase/src/network/kernel/qnetworkproxy.cpp
index 94719e9c2d..6bd6fa2658 100644
--- x/qtbase/src/network/kernel/qnetworkproxy.cpp
+++ y/qtbase/src/network/kernel/qnetworkproxy.cpp
@@ -1634,10 +1634,6 @@ QList<QNetworkProxy> QNetworkProxyFactory::proxyForQuery(const QNetworkProxyQuer
}
#ifndef QT_NO_DEBUG_STREAM
-/*!
- \since 5.0
- Outputs a QNetworkProxy details to a debug stream
-*/
QDebug operator<<(QDebug debug, const QNetworkProxy &proxy)
{
QDebugStateSaver saver(debug);
@@ -1686,6 +1682,21 @@ QDebug operator<<(QDebug debug, const QNetworkProxy &proxy)
debug << '[' << scaps.join(QLatin1Char(' ')) << ']';
return debug;
}
+
+QDebug operator<<(QDebug debug, const QNetworkProxyQuery &proxyQuery)
+{
+ QDebugStateSaver saver(debug);
+ debug.resetFormat().nospace()
+ << "ProxyQuery("
+ << "type: " << proxyQuery.queryType()
+ << ", protocol: " << proxyQuery.protocolTag()
+ << ", peerPort: " << proxyQuery.peerPort()
+ << ", peerHostName: " << proxyQuery.peerHostName()
+ << ", localPort: " << proxyQuery.localPort()
+ << ", url: " << proxyQuery.url()
+ << ')';
+ return debug;
+}
#endif
QT_END_NAMESPACE
diff --git x/qtbase/src/network/kernel/qnetworkproxy.h y/qtbase/src/network/kernel/qnetworkproxy.h
index 8fcb7e33cf..8699c313e9 100644
--- x/qtbase/src/network/kernel/qnetworkproxy.h
+++ y/qtbase/src/network/kernel/qnetworkproxy.h
@@ -56,6 +56,8 @@ class QNetworkConfiguration;
class QNetworkProxyQueryPrivate;
class Q_NETWORK_EXPORT QNetworkProxyQuery
{
+ Q_GADGET
+
public:
enum QueryType {
TcpSocket,
@@ -65,6 +67,7 @@ public:
UrlRequest,
SctpServer
};
+ Q_ENUM(QueryType)
QNetworkProxyQuery();
explicit QNetworkProxyQuery(const QUrl &requestUrl, QueryType queryType = UrlRequest);
@@ -222,6 +225,7 @@ public:
#ifndef QT_NO_DEBUG_STREAM
Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QNetworkProxy &proxy);
+Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QNetworkProxyQuery &proxyQuery);
#endif
QT_END_NAMESPACE
--
2.11.0