diff options
author | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-02-11 10:22:01 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-02-12 10:08:20 +0000 |
commit | cd83859bd6310a2cf0a67c489aa597dc87e326b4 (patch) | |
tree | a6c9472f4e668035775b4f9260a2e8d3f02baf27 /src/network/socket | |
parent | 7997e56a2e5f35fa19da9ccb5dc89586882d951b (diff) |
Network: Fix operator<<(QDebug, ...) operations
Use the
QDebugStateSaver saver(debug);
debug.resetFormat().nospace();
idiom to unify the formatting and whitespace handling.
Change-Id: Id346d63b3f589b60ca19e4459271d587f1a0c003
Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src/network/socket')
-rw-r--r-- | src/network/socket/qabstractsocket.cpp | 4 | ||||
-rw-r--r-- | src/network/socket/qlocalsocket.cpp | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 76874823f0..f9fe40955a 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -2915,6 +2915,8 @@ QNetworkProxy QAbstractSocket::proxy() const #ifndef QT_NO_DEBUG_STREAM Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, QAbstractSocket::SocketError error) { + QDebugStateSaver saver(debug); + debug.resetFormat().nospace(); switch (error) { case QAbstractSocket::ConnectionRefusedError: debug << "QAbstractSocket::ConnectionRefusedError"; @@ -2982,6 +2984,8 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, QAbstractSocket::SocketError er Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, QAbstractSocket::SocketState state) { + QDebugStateSaver saver(debug); + debug.resetFormat().nospace(); switch (state) { case QAbstractSocket::UnconnectedState: debug << "QAbstractSocket::UnconnectedState"; diff --git a/src/network/socket/qlocalsocket.cpp b/src/network/socket/qlocalsocket.cpp index f11972807b..990b282071 100644 --- a/src/network/socket/qlocalsocket.cpp +++ b/src/network/socket/qlocalsocket.cpp @@ -487,6 +487,8 @@ bool QLocalSocket::isSequential() const #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug debug, QLocalSocket::LocalSocketError error) { + QDebugStateSaver saver(debug); + debug.resetFormat().nospace(); switch (error) { case QLocalSocket::ConnectionRefusedError: debug << "QLocalSocket::ConnectionRefusedError"; @@ -527,6 +529,8 @@ QDebug operator<<(QDebug debug, QLocalSocket::LocalSocketError error) QDebug operator<<(QDebug debug, QLocalSocket::LocalSocketState state) { + QDebugStateSaver saver(debug); + debug.resetFormat().nospace(); switch (state) { case QLocalSocket::UnconnectedState: debug << "QLocalSocket::UnconnectedState"; |