From e5bec3abfe2f2463244d65386dbd1088bf56f5f3 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 10 Nov 2016 15:33:48 +0100 Subject: Notification debug stream operator. --- common/CMakeLists.txt | 1 + common/notification.cpp | 26 ++++++++++++++++++++++++++ common/notification.h | 3 +++ 3 files changed, 30 insertions(+) create mode 100644 common/notification.cpp (limited to 'common') diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index b5efb62..a08be8a 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -77,6 +77,7 @@ set(command_SRCS storage/entitystore.cpp indexer.cpp mail/threadindexer.cpp + notification.cpp ${storage_SRCS}) add_library(${PROJECT_NAME} SHARED ${command_SRCS}) diff --git a/common/notification.cpp b/common/notification.cpp new file mode 100644 index 0000000..b399d50 --- /dev/null +++ b/common/notification.cpp @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2016 Christian Mollekopf + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ +#include "notification.h" + +QDebug operator<<(QDebug dbg, const Sink::Notification &n) +{ + dbg << "Notification(Id: " << n.id << ", Type: " << n.type << ", Code: " << n.code << ", Message: " << n.message << ")"; + return dbg.space(); +} diff --git a/common/notification.h b/common/notification.h index 0a267e6..dcf00a3 100644 --- a/common/notification.h +++ b/common/notification.h @@ -21,6 +21,7 @@ #include "sink_export.h" #include +#include namespace Sink { @@ -49,3 +50,5 @@ public: int code; }; } + +QDebug SINK_EXPORT operator<<(QDebug dbg, const Sink::Notification &n); -- cgit v1.2.3