diff options
author | Mavridis Philippe <[email protected]> | 2021-11-13 16:54:31 +0200 |
---|---|---|
committer | Mavridis Philippe <[email protected]> | 2022-01-14 12:36:57 +0200 |
commit | bee2b453da43cadc324821c4c6a42ee915a4661a (patch) | |
tree | 81b75ff1e5195041657a3cb6a98bc3a77df92507 /kweather/weatherservice.cpp | |
parent | 76aebc5aa6a169fc22b6af4103580c935c276172 (diff) | |
download | tdetoys-bee2b453da43cadc324821c4c6a42ee915a4661a.tar.gz tdetoys-bee2b453da43cadc324821c4c6a42ee915a4661a.zip |
KWeather: support for weather icons from icon theme.
Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'kweather/weatherservice.cpp')
-rw-r--r-- | kweather/weatherservice.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kweather/weatherservice.cpp b/kweather/weatherservice.cpp index 9bf3561..110a196 100644 --- a/kweather/weatherservice.cpp +++ b/kweather/weatherservice.cpp @@ -25,6 +25,7 @@ #include <tdeglobal.h> #include <tdelocale.h> #include <kstandarddirs.h> +#include <kiconloader.h> #include "weatherlib.h" #include "weatherservice.h" @@ -148,8 +149,14 @@ TQString WeatherService::currentIconString(const TQString &stationID) TQString WeatherService::iconFileName(const TQString &stationID) { - TQString icon = m_weatherLib->iconName(stationID); - icon = locate( "data", "kweather/" + icon + ".png" ); + TQString _name = m_weatherLib->iconName(stationID); + TQString icon = kapp->iconLoader()->iconPath(_name, TDEIcon::Desktop); + kdDebug(12006) << "icon: " << icon << endl; + if( icon.isNull() ) + { + kdDebug(12006) << "fallback!" << endl; + icon = locate( "data", "kweather/" + _name + ".png" ); + } return icon; } |