[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/base/plasma/applets/weather_station
From: Teemu Rytilahti <tpr () d5k ! net>
Date: 2008-08-01 1:27:38
Message-ID: 1217554058.271413.21763.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 840398 by rytilahti:
adapt to change from WeatherFormula to WeatherUtils
M +14 -14 weatherstation.cpp
M +1 -1 weatherstation.h
--- trunk/playground/base/plasma/applets/weather_station/weatherstation.cpp #840397:840398
@@ -174,11 +174,11 @@
qreal t = tendency.toDouble();
QStringList current;
- if (unit == WeatherFormula::Inches) {
- p = WeatherFormula::convert(p, WeatherFormula::Inches, WeatherFormula::Kilopascals);
- t = WeatherFormula::convert(t, WeatherFormula::Inches, WeatherFormula::Kilopascals);
+ if (unit == WeatherUtils::Inches) {
+ p = WeatherUtils::convert(p, WeatherUtils::Inches, WeatherUtils::Kilopascals);
+ t = WeatherUtils::convert(t, WeatherUtils::Inches, WeatherUtils::Kilopascals);
}
- if (unit == WeatherFormula::Hectopascals) {
+ if (unit == WeatherUtils::Hectopascals) {
p /= 10.0;
t /= 10.0;
}
@@ -196,12 +196,12 @@
}
m_lcd->setGroup("weather", current);
m_lcd->setNumber("pressure", pressure);
- m_lcd->setGroup("pressure_unit", QStringList() << WeatherFormula::getUnitString(unit, true));
+ m_lcd->setGroup("pressure_unit", QStringList() << WeatherUtils::getUnitString(unit, true));
}
void WeatherStation::setTemperature(const QString& temperature, int unit)
{
- m_lcd->setGroup("temp_unit", QStringList() << WeatherFormula::getUnitString(unit, true));
+ m_lcd->setGroup("temp_unit", QStringList() << WeatherUtils::getUnitString(unit, true));
m_lcd->setNumber("temperature", temperature);
}
@@ -221,7 +221,7 @@
m_lcd->setGroup("wind", m_lcd->groupItems("wind"));
} else if(dirInDegrees) {
kDebug() << "dir in degrees:" << dirDegrees;
- direction = WeatherFormula::windDegreesToCardinal(dirDegrees);
+ direction = WeatherUtils::windDegreesToCardinal(dirDegrees);
if(!direction.isEmpty()) {
kDebug() << "got direction:" << direction;
m_lcd->setGroup("wind", QStringList() << direction);
@@ -233,29 +233,29 @@
int toUnit;
switch (c.weatherWindFormat) {
case ConfigData::MetersPerSecond:
- toUnit = WeatherFormula::MetersPerSecond;
+ toUnit = WeatherUtils::MetersPerSecond;
break;
case ConfigData::Kilometers:
- toUnit = WeatherFormula::Kilometers;
+ toUnit = WeatherUtils::Kilometers;
break;
case ConfigData::Miles:
- toUnit = WeatherFormula::Miles;
+ toUnit = WeatherUtils::Miles;
break;
case ConfigData::Knots:
- toUnit = WeatherFormula::Knots;
+ toUnit = WeatherUtils::Knots;
break;
case ConfigData::Beaufort:
- toUnit = WeatherFormula::Beaufort;
+ toUnit = WeatherUtils::Beaufort;
break;
}
double windSpeed;
if(fromUnit != toUnit)
- windSpeed = WeatherFormula::convert(speed.toDouble(), fromUnit, toUnit);
+ windSpeed = WeatherUtils::convert(speed.toDouble(), fromUnit, toUnit);
else
windSpeed = speed.toDouble();
- QString unit(WeatherFormula::getUnitString(toUnit, true));
+ QString unit(WeatherUtils::getUnitString(toUnit, true));
kDebug() << "windspeed:" << windSpeed << "windunit: " << unit;
m_lcd->setNumber("wind_speed", QString::number(windSpeed, 'f', 1));
m_lcd->setGroup("wind_unit", QStringList() << unit);
--- trunk/playground/base/plasma/applets/weather_station/weatherstation.h #840397:840398
@@ -21,7 +21,7 @@
#include <weatherconfig.h>
#include <Plasma/Applet>
#include <Plasma/DataEngine>
-#include <plasma/weather/formulas.h>
+#include <plasma/weather/weatherutils.h>
class LCD;
class QGraphicsLinearLayout;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic