diff options
author | Kari Oikarinen <kari.oikarinen@qt.io> | 2016-09-22 10:29:38 +0300 |
---|---|---|
committer | Kari Oikarinen <kari.oikarinen@qt.io> | 2016-09-23 08:39:34 +0000 |
commit | a132c64b5d590516869a252a4a6fc823787c4b61 (patch) | |
tree | 0e403a0bec20abffbf9b553973dc63e0e9f504bf /libqdb | |
parent | 44c400ea9bc2a16bbd0be9fa395dc0644a7024cb (diff) |
Move operator implementations inside namespace
In commit 7be7316aeec7eb3e63dde518ae021988c6ad93b6 "Make forward
declarations namespace aware" the forward declarations were wrapped with
QT_{BEGIN,END}_NAMESPACE. Several of them were forgotten and are wrapped
in this commit.
The unit tests for QdbMessage still failed with the linker not finding the
operator<<(QDataStream &, QdbMessage &). This commit fixes it.
Task-number: QTBUG-56066
Change-Id: I1ce9774a6f05f3907e334def40b365fdde32c2bb
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
Diffstat (limited to 'libqdb')
-rw-r--r-- | libqdb/protocol/qdbmessage.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/libqdb/protocol/qdbmessage.cpp b/libqdb/protocol/qdbmessage.cpp index 9a9f26f..7f30808 100644 --- a/libqdb/protocol/qdbmessage.cpp +++ b/libqdb/protocol/qdbmessage.cpp @@ -109,15 +109,6 @@ void QdbMessage::setData(const char *data, int length) m_data = QByteArray{data, length}; } -QDataStream &operator<<(QDataStream &stream, const QdbMessage &message) -{ - stream << message.command(); - stream << message.hostStream() << message.deviceStream(); - stream << message.data(); - - return stream; -} - QdbMessage::CommandType toCommandType(uint32_t command) { switch (command) { @@ -135,6 +126,17 @@ QdbMessage::CommandType toCommandType(uint32_t command) return QdbMessage::Invalid; } +QT_BEGIN_NAMESPACE + +QDataStream &operator<<(QDataStream &stream, const QdbMessage &message) +{ + stream << message.command(); + stream << message.hostStream() << message.deviceStream(); + stream << message.data(); + + return stream; +} + QDataStream &operator>>(QDataStream &stream, QdbMessage &message) { uint32_t command; @@ -156,7 +158,7 @@ QDataStream &operator>>(QDataStream &stream, QdbMessage &message) return stream; } -QDebug &operator<<(QDebug &stream, QdbMessage::CommandType command) +QDebug &operator<<(QDebug &stream, ::QdbMessage::CommandType command) { switch (command) { case QdbMessage::Invalid: @@ -188,3 +190,5 @@ QDebug &operator<<(QDebug &stream, const QdbMessage &message) return stream; } + +QT_END_NAMESPACE |