summaryrefslogtreecommitdiff
path: root/testnotification/testnotificationprovider.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2012-08-11 15:30:38 +0200
committerJavier S. Pedro <maemo@javispedro.com>2012-08-11 15:30:38 +0200
commit51701e30d710ad016ddf2d306cdd7be122ddf25b (patch)
treed4a85bd4926c3f94411d3f6fa572e1a99be6bbb4 /testnotification/testnotificationprovider.cpp
parentf0564ad9d210cc68bfb1bfc6e56b86fa941ad830 (diff)
downloadsowatch-51701e30d710ad016ddf2d306cdd7be122ddf25b.tar.gz
sowatch-51701e30d710ad016ddf2d306cdd7be122ddf25b.zip
adding test notification backend
Diffstat (limited to 'testnotification/testnotificationprovider.cpp')
-rw-r--r--testnotification/testnotificationprovider.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/testnotification/testnotificationprovider.cpp b/testnotification/testnotificationprovider.cpp
new file mode 100644
index 0000000..960f450
--- /dev/null
+++ b/testnotification/testnotificationprovider.cpp
@@ -0,0 +1,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);
+}