aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAki Koskinen <aki.koskinen@nokia.com>2010-11-04 15:20:49 +0200
committerAki Koskinen <aki.koskinen@nokia.com>2010-11-10 13:41:42 +0200
commitb03f58c4e223630f1ad72aa13dba8db5940adeda (patch)
treee8c5808db7d9d9096bd0f2f496cd1667bc48a601 /tools
parentb54f28781c230ca4e77088af3ffb885e41d335ab (diff)
Changes: mnotificationtool can query also notification groups
RevBy: Pauli Lehtinen
Diffstat (limited to 'tools')
-rw-r--r--tools/mnotificationtool/mnotificationtool.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/tools/mnotificationtool/mnotificationtool.cpp b/tools/mnotificationtool/mnotificationtool.cpp
index 403db0ea..b1f2f4bd 100644
--- a/tools/mnotificationtool/mnotificationtool.cpp
+++ b/tools/mnotificationtool/mnotificationtool.cpp
@@ -218,12 +218,28 @@ int main(int argc, char *argv[])
// Calls notificationIdList from NotificationManager. Returns size of the list from main.
if (listMode) {
- QList<MNotification *> list = MNotification::notifications();
+ QList<MNotification*> list;
+ std::string itemName;
+ std::string itemNameCapital;
+ if (groupMode) {
+ QList<MNotificationGroup*> tmpList = MNotificationGroup::notificationGroups();
+ foreach (MNotificationGroup* group, tmpList) {
+ list.append(group);
+ }
+
+ itemName = "notification groups";
+ itemNameCapital = "Notification groups";
+ } else {
+ list = MNotification::notifications();
+ itemName = "notifications";
+ itemNameCapital = "Notifications";
+ }
+
result = list.size();
- std::cout << "\n" << list.size() << " notifications." << std::endl;
+ std::cout << list.size() << " " << itemName << "." << std::endl;
if (list.size() > 0) {
- std::cout << "Notifications:" << std::endl;
- std::cout << "Id\tType\tSummary\tBody\tImage\tCount" << std::endl;
+ std::cout << itemNameCapital << ":" << std::endl;
+ std::cout << "Id\tType\tSummary\tBody\tImage\tCount\tIdentifier" << std::endl;
foreach(MNotification *notification, list) {
MNotificationToolNotification *toolNotification = static_cast<MNotificationToolNotification *>(notification);
std::cout << toolNotification->id() << "\t" <<