[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: KDE/kdeplasma-addons/applets/weatherstation
From: Petri =?utf-8?q?Damst=C3=A9n?= <petri.damsten () gmail ! com>
Date: 2010-12-13 7:47:24
Message-ID: 201012130947.28830.petri.damsten () gmail ! com
[Download RAW message or body]
On Saturday, December 11, 2010 20:01:35 Marco Martin wrote:
> SVN commit 1205588 by mart:
>
> show N/A if the temperature is not available fr engines like wetter.com.
> the plasmoid is completely useless in this case, but this isn't
> something we can do anything about, since the data is missing from the
> web service
> BUG:259471
>
>
> M +5 -0 weatherstation.cpp
>
>
> --- trunk/KDE/kdeplasma-addons/applets/weatherstation/weatherstation.cpp
> #1205587:1205588 @@ -264,6 +264,10 @@
>
> void WeatherStation::setTemperature(const Value& temperature, bool
> hasDigit) {
> + if (!temperature.isValid()) {
> + m_lcd->setNumber("temperature", "N/A");
> + m_lcdPanel->setNumber("temperature", "N/A");
> + } else {
> hasDigit = hasDigit || (temperatureUnit() != temperature.unit());
> Value v = temperature.convertTo(temperatureUnit());
> m_lcd->setLabel("temperature-unit-label", v.unit()->symbol());
> @@ -272,6 +276,7 @@
> m_lcd->setNumber("temperature", tmp);
> tmp = hasDigit ? fitValue(v , 3) : QString::number(v.number());
> m_lcdPanel->setNumber("temperature", tmp);
> + }
> setLCDIcon();
> }
fitValue used in setTemperature, setWind, etc. already sets value to "-" if
it's invalid, so this should not be needed. Problem is that converter returns
valid value for invalid value here, I'll fix it.
Petri
["signature.asc" (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic