summaryrefslogtreecommitdiff
path: root/meegohandsetnotification/watchnotificationsink.cpp
blob: 860c4b62cd0f68a578e9fbd70433c9f805af4b15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "meegohandsetnotificationprovider.h"
#include "watchnotificationsink.h"

WatchNotificationSink::WatchNotificationSink(sowatch::MeegoHandsetNotificationProvider *parent) :
	NotificationSink(parent)
{

}

void WatchNotificationSink::addNotification(const Notification &notification)
{
	const uint notificationId = notification.notificationId();

	if (_trackedNotifications.contains(notificationId)) {
		MeegoHandsetNotification* n = _trackedNotifications[notificationId];
		n->changeTo(notification);
	} else {
		MeegoHandsetNotification* n = new MeegoHandsetNotification(notification, this);
		_trackedNotifications[notificationId] = n;
		emit incomingNotification(static_cast<sowatch::Notification*>(n));
	}
}

void WatchNotificationSink::removeNotification(uint notificationId)
{
	if (_trackedNotifications.contains(notificationId)) {
		MeegoHandsetNotification* n = _trackedNotifications[notificationId];
		_trackedNotifications.remove(notificationId);
		n->remove();
		n->deleteLater();
	}
}

void WatchNotificationSink::addGroup(uint groupId, const NotificationParameters &parameters)
{
	// We do not care about notification groups
	Q_UNUSED(groupId);
	Q_UNUSED(parameters);
}

void WatchNotificationSink::removeGroup(uint groupId)
{
	Q_UNUSED(groupId);
}