diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2011-10-02 16:39:40 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2011-10-02 16:39:40 +0200 |
commit | 0a656b75f3fc80f13424db0e7ec403dff28a366e (patch) | |
tree | 23f72a2fde3f718048b49d9806ded3d315d50a80 /meegohandsetnotification | |
parent | d9f132f3d5bf41ee4f30e7ea2bd1b61120fa29b7 (diff) | |
download | sowatch-0a656b75f3fc80f13424db0e7ec403dff28a366e.tar.gz sowatch-0a656b75f3fc80f13424db0e7ec403dff28a366e.zip |
new notifications list, time syncing
Diffstat (limited to 'meegohandsetnotification')
-rw-r--r-- | meegohandsetnotification/meegohandsetnotification.cpp | 27 | ||||
-rw-r--r-- | meegohandsetnotification/meegohandsetnotification.h | 7 | ||||
-rw-r--r-- | meegohandsetnotification/watchnotificationsink.cpp | 2 |
3 files changed, 27 insertions, 9 deletions
diff --git a/meegohandsetnotification/meegohandsetnotification.cpp b/meegohandsetnotification/meegohandsetnotification.cpp index 69e2bd5..41264b6 100644 --- a/meegohandsetnotification/meegohandsetnotification.cpp +++ b/meegohandsetnotification/meegohandsetnotification.cpp @@ -48,14 +48,35 @@ void MeegoHandsetNotification::activate() // TODO Actually do something } -void MeegoHandsetNotification::clear() +void MeegoHandsetNotification::dismiss() { - // TODO Actually clear... - emit cleared(); + // TODO Actually dismiss } void MeegoHandsetNotification::changeTo(const ::Notification ¬ification) { + uint oldCount = count(); + QDateTime oldDateTime = dateTime(); + QString oldTitle = title(); + QString oldBody = body(); _n = notification; + if (oldCount != count()) { + emit countChanged(); + } + if (oldDateTime != dateTime()) { + emit dateTimeChanged(); + emit displayTimeChanged(); + } + if (oldTitle != title()) { + emit titleChanged(); + } + if (oldBody != body()) { + emit bodyChanged(); + } emit changed(); } + +void MeegoHandsetNotification::remove() +{ + emit dismissed(); +} diff --git a/meegohandsetnotification/meegohandsetnotification.h b/meegohandsetnotification/meegohandsetnotification.h index fc9d50f..06cacf9 100644 --- a/meegohandsetnotification/meegohandsetnotification.h +++ b/meegohandsetnotification/meegohandsetnotification.h @@ -19,14 +19,11 @@ public: QString title() const; QString body() const; void activate(); - void clear(); - -signals: - void changed(); - void cleared(); + void dismiss(); protected: void changeTo(const ::Notification& notification); + void remove(); protected: ::Notification _n; diff --git a/meegohandsetnotification/watchnotificationsink.cpp b/meegohandsetnotification/watchnotificationsink.cpp index cf03c30..860c4b6 100644 --- a/meegohandsetnotification/watchnotificationsink.cpp +++ b/meegohandsetnotification/watchnotificationsink.cpp @@ -26,7 +26,7 @@ void WatchNotificationSink::removeNotification(uint notificationId) if (_trackedNotifications.contains(notificationId)) { MeegoHandsetNotification* n = _trackedNotifications[notificationId]; _trackedNotifications.remove(notificationId); - n->clear(); + n->remove(); n->deleteLater(); } } |