diff options
Diffstat (limited to 'kweather/weatherlib.cpp')
-rw-r--r-- | kweather/weatherlib.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/kweather/weatherlib.cpp b/kweather/weatherlib.cpp index 32d653c..a7bb13c 100644 --- a/kweather/weatherlib.cpp +++ b/kweather/weatherlib.cpp @@ -272,14 +272,34 @@ TQString WeatherLib::windChill(const TQString &stationID){ TQString WeatherLib::iconName(const TQString &stationID){ - TQString result = WeatherIcon::unknown(); + TQString result; + + // isEmpty is true for null or 0 length strings + if ( !stationID.isEmpty() ) + { + Data *d = findData(stationID); + result = d->wi.iconName; + } + + if( result == TQString::null ) + result = WeatherIcon::unknown(); + + return result; +} + +TQString WeatherLib::iconPath(const TQString &stationID){ + + TQString result; // isEmpty is true for null or 0 length strings if ( !stationID.isEmpty() ) { Data *d = findData(stationID); - result = d->wi.theWeather; + result = d->wi.iconPath; } + + if( result == TQString::null ) + result = WeatherIconPrivate::instance()->iconPath(WeatherIcon::unknown()); return result; } |