summaryrefslogtreecommitdiff
path: root/harmaccuweather/harmaccuprovider.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2011-10-16 04:42:30 +0200
committerJavier S. Pedro <maemo@javispedro.com>2011-10-16 04:42:30 +0200
commit4da9bced6a27b92d49b9fc9392946510b8519d82 (patch)
tree7a2417a932a6463e3e6f6ec4d3799e24de917306 /harmaccuweather/harmaccuprovider.cpp
parentbde4bde8ec9d6d09874d5ae9e0ba6dc9431859b6 (diff)
downloadsowatch-4da9bced6a27b92d49b9fc9392946510b8519d82.tar.gz
sowatch-4da9bced6a27b92d49b9fc9392946510b8519d82.zip
Initial implementation of weather
Diffstat (limited to 'harmaccuweather/harmaccuprovider.cpp')
-rw-r--r--harmaccuweather/harmaccuprovider.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/harmaccuweather/harmaccuprovider.cpp b/harmaccuweather/harmaccuprovider.cpp
new file mode 100644
index 0000000..af4a8d0
--- /dev/null
+++ b/harmaccuweather/harmaccuprovider.cpp
@@ -0,0 +1,29 @@
+#include <QtCore/QtDebug>
+#include <QtCore/QTimer>
+#include "harmaccuweather.h"
+#include "harmaccuprovider.h"
+
+using namespace sowatch;
+
+HarmAccuProvider::HarmAccuProvider(int updateTime, QObject *parent) :
+ NotificationProvider(parent),
+ _updateTime(updateTime)
+{
+ // Give some time to send the notification
+ QTimer::singleShot(2000, this, SLOT(generateNotification()));
+}
+
+HarmAccuProvider::~HarmAccuProvider()
+{
+
+}
+
+void HarmAccuProvider::generateNotification()
+{
+ QSettings* s = HarmAccuWeather::getAccuweatherData();
+ if (s->contains("LastUpdate")) {
+ qDebug() << "generate harmaccuweather notification";
+ emit incomingNotification(new HarmAccuWeather(_updateTime, this));
+ }
+ delete s;
+}