diff options
Diffstat (limited to 'common/notification.cpp')
-rw-r--r-- | common/notification.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/common/notification.cpp b/common/notification.cpp index 806d04a..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 | ||
22 | using namespace Sink; | ||
23 | |||
24 | static 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 | |||
22 | QDebug operator<<(QDebug dbg, const Sink::Notification &n) | 49 | QDebug operator<<(QDebug dbg, const Sink::Notification &n) |
23 | { | 50 | { |
24 | dbg << "Notification(Type: " << n.type << "Id, : " << n.id << ", Code: " << n.code << ", Message: " << n.message << ", Entities: " << n.entities << ")"; | 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 | } |