summaryrefslogtreecommitdiff
path: root/meegohandsetnotification
diff options
context:
space:
mode:
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();
}
}