summaryrefslogtreecommitdiff
path: root/meegohandsetnotification
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2011-09-24 00:31:46 +0200
committerJavier S. Pedro <maemo@javispedro.com>2011-09-24 00:31:46 +0200
commitcba26597f1c09764d37be0d13863ec5d5c340da0 (patch)
tree5559b1274c228673e2bd519135de8de596c7e91b /meegohandsetnotification
parentb414dbdb28d839c9755b1832f27f61d1ec9e7863 (diff)
downloadsowatch-cba26597f1c09764d37be0d13863ec5d5c340da0.tar.gz
sowatch-cba26597f1c09764d37be0d13863ec5d5c340da0.zip
new partially working incoming call plugin
Diffstat (limited to 'meegohandsetnotification')
-rw-r--r--meegohandsetnotification/watchnotificationsink.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/meegohandsetnotification/watchnotificationsink.cpp b/meegohandsetnotification/watchnotificationsink.cpp
index 0d97562..c80c4ae 100644
--- a/meegohandsetnotification/watchnotificationsink.cpp
+++ b/meegohandsetnotification/watchnotificationsink.cpp
@@ -13,10 +13,16 @@ void WatchNotificationSink::addNotification(const Notification &notification)
{
const NotificationParameters& p = notification.parameters();
sowatch::Notification::Type type = notificationTypeFromEventType(p.value("eventType").toString());
- uint count = p.value("count").toUInt();
+ const uint count = p.value("count").toUInt();
+ const uint notificationId = notification.notificationId();
+
+ if (_trackedNotifications.contains(notificationId)) {
+ const NotificationParameters& oldParams = _trackedNotifications[notificationId].parameters();
+ _counts[type] -= oldParams.value("count").toUInt();
+ }
_counts[type] += count;
- _trackedNotifications[notification.notificationId()] = notification;
+ _trackedNotifications[notificationId] = notification;
emit countsChanged(type);
@@ -61,12 +67,17 @@ int WatchNotificationSink::getCount(sowatch::Notification::Type type)
sowatch::Notification::Type WatchNotificationSink::notificationTypeFromEventType(const QString& eventType)
{
+ qDebug() << "incoming " << eventType;
if (eventType == "email.arrived")
return sowatch::Notification::EmailNotification;
else if (eventType == "x-nokia.call.missed")
return sowatch::Notification::MissedCallNotification;
else if (eventType == "x-nokia.messaging.im")
return sowatch::Notification::ImNotification;
+ else if (eventType == "x-nokia.messaging.sms")
+ return sowatch::Notification::SmsNotification;
+ else if (eventType == "x-nokia.messaging.mms")
+ return sowatch::Notification::MmsNotification;
else
return sowatch::Notification::OtherNotification;
}