summaryrefslogtreecommitdiff
path: root/meecastweather/meecastprovider.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2012-08-15 15:53:09 +0200
committerJavier S. Pedro <maemo@javispedro.com>2012-08-15 15:53:09 +0200
commit2ecf718cc9d460ad192de196aac8d13e30a7ab4c (patch)
tree28ad0698f48e563ff0cca74c780e283ad16b7994 /meecastweather/meecastprovider.cpp
parentc752ccafd8d826b3c0c9140e89ece09e90b34cb1 (diff)
downloadsowatch-2ecf718cc9d460ad192de196aac8d13e30a7ab4c.tar.gz
sowatch-2ecf718cc9d460ad192de196aac8d13e30a7ab4c.zip
preparing meecastweather plugin
Diffstat (limited to 'meecastweather/meecastprovider.cpp')
-rw-r--r--meecastweather/meecastprovider.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/meecastweather/meecastprovider.cpp b/meecastweather/meecastprovider.cpp
new file mode 100644
index 0000000..2c26b67
--- /dev/null
+++ b/meecastweather/meecastprovider.cpp
@@ -0,0 +1,29 @@
+#include <QtCore/QtDebug>
+#include <QtCore/QTimer>
+#include "harmaccuweather.h"
+#include "harmaccuprovider.h"
+
+using namespace sowatch;
+
+HarmAccuProvider::HarmAccuProvider(QObject *parent) :
+ NotificationProvider(parent)
+{
+ // Give some time to send the first notification
+ QTimer::singleShot(2000, this, SLOT(generateNotification()));
+}
+
+HarmAccuProvider::~HarmAccuProvider()
+{
+}
+
+void HarmAccuProvider::generateNotification()
+{
+ QSettings* s = HarmAccuWeather::getAccuweatherData();
+ if (s->contains("LastUpdate")) {
+ qDebug() << "generating harmaccuweather notification";
+ emit incomingNotification(new HarmAccuWeather(this));
+ } else {
+ qWarning() << "Accuweather config file does not seem to exist";
+ }
+ delete s;
+}