summaryrefslogtreecommitdiff
path: root/testnotification/testnotificationprovider.cpp
blob: 960f450091bbb9b978c58a5384d3078bd4ff0f70 (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
#include "testnotification.h"
#include "testnotificationprovider.h"

using namespace sowatch;

TestNotificationProvider::TestNotificationProvider(QObject *parent) :
    NotificationProvider(parent),
    _timer(new QTimer(this))
{
	QTimer::singleShot(15000, this, SLOT(generateInitialNotification()));
	connect(_timer, SIGNAL(timeout()), SLOT(generateNotification()));
	_timer->setInterval(60000);
	_timer->start();
}

TestNotificationProvider::~TestNotificationProvider()
{
}

void TestNotificationProvider::generateInitialNotification()
{
	TestNotification *n = new TestNotification(Notification::EmailNotification,
	                                           "A friend",
	                                           "This is a test email notification");
	emit incomingNotification(n);
}

void TestNotificationProvider::generateNotification()
{
	TestNotification *n = new TestNotification(Notification::ImNotification,
	                                           "A friend",
	                                           "I will keep talking to you");
	emit incomingNotification(n);
}