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