summaryrefslogtreecommitdiffstats
path: root/common/notification.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/notification.cpp')
-rw-r--r--common/notification.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/common/notification.cpp b/common/notification.cpp
index b399d50..e688b6d 100644
--- a/common/notification.cpp
+++ b/common/notification.cpp
@@ -19,8 +19,37 @@
19 */ 19 */
20#include "notification.h" 20#include "notification.h"
21 21
22using namespace Sink;
23
24static QByteArray name(int type)
25{
26 switch (type) {
27 case Notification::Shutdown:
28 return "shutdown";
29 case Notification::Status:
30 return "status";
31 case Notification::Info:
32 return "info";
33 case Notification::Warning:
34 return "warning";
35 case Notification::Error:
36 return "error";
37 case Notification::Progress:
38 return "progress";
39 case Notification::Inspection:
40 return "inspection";
41 case Notification::RevisionUpdate:
42 return "revisionupdate";
43 case Notification::FlushCompletion:
44 return "flushcompletion";
45 }
46 return "Unknown:" + QByteArray::number(type);
47}
48
22QDebug operator<<(QDebug dbg, const Sink::Notification &n) 49QDebug operator<<(QDebug dbg, const Sink::Notification &n)
23{ 50{
24 dbg << "Notification(Id: " << n.id << ", Type: " << n.type << ", Code: " << n.code << ", Message: " << n.message << ")"; 51 dbg << "Notification(Type: " << name(n.type) << "Id, : " << n.id << ", Code: ";
52 dbg << n.code;
53 dbg << ", Message: " << n.message << ", Entities: " << n.entities << ")";
25 return dbg.space(); 54 return dbg.space();
26} 55}