diff options
author | Aki Koskinen <aki.koskinen@nokia.com> | 2010-11-05 13:13:20 +0200 |
---|---|---|
committer | Aki Koskinen <aki.koskinen@nokia.com> | 2010-11-05 13:13:20 +0200 |
commit | 2d43ba534712f47aec88328cd14174c22fd10ff3 (patch) | |
tree | 49710444b706eea780ec10528228e3bf7631da59 /tools | |
parent | 5cd72c2a3bba1daefd5b44809ec9923edb4933c1 (diff) |
Changes: print headers for the notification data
RevBy: TrustMe
Diffstat (limited to 'tools')
-rw-r--r-- | tools/mnotificationtool/mnotificationtool.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tools/mnotificationtool/mnotificationtool.cpp b/tools/mnotificationtool/mnotificationtool.cpp index 4446511f..9891f846 100644 --- a/tools/mnotificationtool/mnotificationtool.cpp +++ b/tools/mnotificationtool/mnotificationtool.cpp @@ -212,18 +212,20 @@ int main(int argc, char *argv[]) QList<MNotification *> list = MNotification::notifications(); result = list.size(); std::cout << "\n" << list.size() << " notifications." << std::endl; - std::cout << "Notifications:" << std::endl; - foreach(MNotification *notification, list) { - MNotificationToolNotification *toolNotification = static_cast<MNotificationToolNotification *>(notification); - std::cout << toolNotification->id() << "\t" << - toolNotification->eventType().toUtf8().constData() << "\t" << - toolNotification->summary().toUtf8().constData() << "\t" << - toolNotification->body().toUtf8().constData() << "\t" << - toolNotification->image().toUtf8().constData() << "\t" << - toolNotification->count() << std::endl; - delete notification; + if (list.size() > 0) { + std::cout << "Notifications:" << std::endl; + std::cout << "Id\tType\tSummary\tBody\tImage\tCount" << std::endl; + foreach(MNotification *notification, list) { + MNotificationToolNotification *toolNotification = static_cast<MNotificationToolNotification *>(notification); + std::cout << toolNotification->id() << "\t" << + toolNotification->eventType().toUtf8().constData() << "\t" << + toolNotification->summary().toUtf8().constData() << "\t" << + toolNotification->body().toUtf8().constData() << "\t" << + toolNotification->image().toUtf8().constData() << "\t" << + toolNotification->count() << std::endl; + delete notification; + } } - list.clear(); } // Execute the desired action |