[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [plasma-workspace] dataengines/weather/ions/noaa: Weather DataEngine/NOAA ion: Port to Plasma2 ++
From:       Davide Bettio <bettio () kde ! org>
Date:       2014-04-23 15:55:19
Message-ID: E1WczW3-0008NO-Bj () scm ! kde ! org
[Download RAW message or body]

Git commit 7313ba240bc83bfdbe22a7f7dd911603f2bb2ab7 by Davide Bettio.
Committed on 23/04/2014 at 15:50.
Pushed by bettio into branch 'master'.

Weather DataEngine/NOAA ion: Port to Plasma2 ++

Signed-off-by: Davide Bettio <bettio@kde.org>

M  +1    -1    dataengines/weather/ions/noaa/CMakeLists.txt
M  +7    -1    dataengines/weather/ions/noaa/ion_noaa.cpp
M  +2    -4    dataengines/weather/ions/noaa/ion_noaa.h

http://commits.kde.org/plasma-workspace/7313ba240bc83bfdbe22a7f7dd911603f2bb2ab7

diff --git a/dataengines/weather/ions/noaa/CMakeLists.txt b/dataengines/weather/ions/noaa/CMakeLists.txt
index a0edcab..6909ce5 100644
--- a/dataengines/weather/ions/noaa/CMakeLists.txt
+++ b/dataengines/weather/ions/noaa/CMakeLists.txt
@@ -1,6 +1,6 @@
 set (ion_noaa_SRCS ion_noaa.cpp)
 add_library(ion_noaa MODULE ${ion_noaa_SRCS})
-target_link_libraries (ion_noaa KF5::Solid weather_ion)
+target_link_libraries (ion_noaa KF5::Solid KF5::KDELibs4Support KF5::I18n weather_ion)
 
 install (FILES ion-noaa.desktop DESTINATION ${SERVICES_INSTALL_DIR})
 
diff --git a/dataengines/weather/ions/noaa/ion_noaa.cpp b/dataengines/weather/ions/noaa/ion_noaa.cpp
index a1f54bf..2f51d0c 100644
--- a/dataengines/weather/ions/noaa/ion_noaa.cpp
+++ b/dataengines/weather/ions/noaa/ion_noaa.cpp
@@ -21,9 +21,10 @@
 
 #include "ion_noaa.h"
 
+#include <KUrl>
 #include <KIO/Job>
 #include <KLocalizedDate>
-
+#include <QDebug>
 #include <KUnitConversion/Converter>
 
 QMap<QString, IonInterface::WindDirections> NOAAIon::setupWindIconMappings(void) const
@@ -463,6 +464,8 @@ void NOAAIon::updateWeather(const QString& source)
     data.insert("Current Conditions", conditionI18n(source));
     qDebug() << "i18n condition string: " << qPrintable(conditionI18n(source));
 
+//TODO: Port to Plasma2
+#if 0
     // Determine the weather icon based on the current time and computed sunrise/sunset time.
     const Plasma::DataEngine::Data timeData = m_timeEngine->query(
             QString("Local|Solar|Latitude=%1|Longitude=%2")
@@ -474,11 +477,13 @@ void NOAAIon::updateWeather(const QString& source)
 
     // Provide mapping for the condition-type to the icons to display
     if (currentTime > sunriseTime && currentTime < sunsetTime) {
+#endif
         // Day
         QString weather = condition(source).toLower();
         ConditionIcons condition = getConditionIcon(weather, true);
         data.insert("Condition Icon", getWeatherIcon(condition));
         qDebug() << "Using daytime icons\n";
+#if 0
     } else {
         // Night
         QString weather = condition(source).toLower();
@@ -486,6 +491,7 @@ void NOAAIon::updateWeather(const QString& source)
         data.insert("Condition Icon", getWeatherIcon(condition));
         qDebug() << "Using nighttime icons\n";
     }
+#endif
 
     dataFields = temperature(source);
     data.insert("Temperature", dataFields["temperature"]);
diff --git a/dataengines/weather/ions/noaa/ion_noaa.h b/dataengines/weather/ions/noaa/ion_noaa.h
index d4e9a61..ea74814 100644
--- a/dataengines/weather/ions/noaa/ion_noaa.h
+++ b/dataengines/weather/ions/noaa/ion_noaa.h
@@ -22,7 +22,7 @@
 #ifndef ION_NOAA_H
 #define ION_NOAA_H
 
-#include <QtXml/QXmlStreamReader>
+#include <QXmlStreamReader>
 #include <QStringList>
 #include <QDateTime>
 
@@ -34,8 +34,8 @@ namespace KIO
 #include <kdemacros.h>
 
 #include <Plasma/DataEngine>
+#include <Plasma/DataEngineConsumer>
 
-#include "../dataengineconsumer.h"
 #include "../ion.h"
 
 class WeatherData
@@ -180,6 +180,4 @@ private:
     QStringList m_sourcesToReset;
 };
 
-K_EXPORT_PLASMA_DATAENGINE(noaa, NOAAIon)
-
 #endif
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic