summaryrefslogtreecommitdiff
path: root/testnotification/testnotificationprovider.cpp
diff options
context:
space:
mode:
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);
+}