From 4da9bced6a27b92d49b9fc9392946510b8519d82 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sun, 16 Oct 2011 04:42:30 +0200 Subject: Initial implementation of weather --- harmaccuweather/harmaccuprovider.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 harmaccuweather/harmaccuprovider.cpp (limited to 'harmaccuweather/harmaccuprovider.cpp') 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 +#include +#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; +} -- cgit v1.2.3