summaryrefslogtreecommitdiff
path: root/meegohandsetnotification
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2011-10-02 16:39:40 +0200
committerJavier S. Pedro <maemo@javispedro.com>2011-10-02 16:39:40 +0200
commit0a656b75f3fc80f13424db0e7ec403dff28a366e (patch)
tree23f72a2fde3f718048b49d9806ded3d315d50a80 /meegohandsetnotification
parentd9f132f3d5bf41ee4f30e7ea2bd1b61120fa29b7 (diff)
downloadsowatch-0a656b75f3fc80f13424db0e7ec403dff28a366e.tar.gz
sowatch-0a656b75f3fc80f13424db0e7ec403dff28a366e.zip
new notifications list, time syncing
Diffstat (limited to 'meegohandsetnotification')
-rw-r--r--meegohandsetnotification/meegohandsetnotification.cpp27
-rw-r--r--meegohandsetnotification/meegohandsetnotification.h7
-rw-r--r--meegohandsetnotification/watchnotificationsink.cpp2
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 &notification)
{
+ 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();
}
}