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

List:       kde-commits
Subject:    playground/base/plasma/ions/weather.savonia.fi
From:       Teemu Rytilahti <tpr () d5k ! net>
Date:       2008-07-31 21:19:20
Message-ID: 1217539160.481030.11706.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 840319 by rytilahti:

use WeatherFormula::Unit, this makes it work with the new weatherstation.
currently the unit types are defined statically though.

CCMAIL:petri.damsten@kdemail.net


 M  +5 -3      ion_savonia_fi.cpp  


--- trunk/playground/base/plasma/ions/weather.savonia.fi/ion_savonia_fi.cpp #840318:840319
@@ -23,6 +23,8 @@
 #include <KJob>
 #include <QDomDocument>
 
+#include <plasma/weather/formulas.h>
+
 #define URL "http://weather2.savonia.fi/datas/savoniaweather.xml"
 //#define URL "http://localhost/savoniaweather.xml"
 
@@ -121,7 +123,7 @@
                     //m_data["Wind Speed Unit"] = unit;
                     m_data["Wind Speed"] =
                             QString::number(value.toDouble() / 1000.0 * 3600.0, 'f', 1);
-                    m_data["Wind Speed Unit"] = "km/h";
+                    m_data["Wind Speed Unit"] = WeatherFormula::Kilometers;
                 }
                 break;
             case 19:
@@ -132,7 +134,7 @@
                 break;
             case 21:
                 if (subId == 0) {
-                    m_data["Pressure Unit"] = unit;
+                    m_data["Pressure Unit"] = WeatherFormula::Hectopascals;
                     m_data["Pressure"] = QString::number(value.toDouble(), 'f', 1);
                 } else if (subId == 1) {
                     m_data["Pressure Tendency"] = value;
@@ -141,7 +143,7 @@
             case 22:
                 if (subId == 0) {
                     m_data["Temperature"] = QString::number(value.toDouble(), 'f', 1);
-                    m_data["Temperature Unit"] = unit;
+                    m_data["Temperature Unit"] = WeatherFormula::Celsius;
                 }
                 break;
             case 24:
[prev in list] [next in list] [prev in thread] [next in thread] 

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