diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2021-12-12 15:50:37 +0200 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2022-01-14 12:39:01 +0200 |
commit | 6668b34bc5deb36e73aa45e0457ed6740f828efd (patch) | |
tree | f2ff95858cc06d5eaad187b6750717a58a175a60 /kweather/weatherservice.cpp | |
parent | 67e995b6fc4da17811aefb7c8d841c9812e4eec9 (diff) | |
download | tdetoys-6668b34bc5deb36e73aa45e0457ed6740f828efd.tar.gz tdetoys-6668b34bc5deb36e73aa45e0457ed6740f828efd.zip |
Implemented icon theme option.
Changes in this commit include:
* The option itself;
* A method of updating the option right after Apply or Ok is pressed
in the settings dialog;
* A new WeatherIconPrivate class to store the methods previously
in WeatherIcons, as well as the settings;
* Improved icon name helper function in METAR parser;
* A few cleanups to the WeatherIcon class.
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'kweather/weatherservice.cpp')
-rw-r--r-- | kweather/weatherservice.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/kweather/weatherservice.cpp b/kweather/weatherservice.cpp index f54d803..556a015 100644 --- a/kweather/weatherservice.cpp +++ b/kweather/weatherservice.cpp @@ -30,6 +30,7 @@ #include "weatherlib.h" #include "weatherservice.h" #include "stationdatabase.h" +#include "weather_icon.h" #include "sun.h" WeatherService::WeatherService(TQObject *parent, const char *name) : TQObject (parent, name), DCOPObject("WeatherService") @@ -150,13 +151,18 @@ TQString WeatherService::currentIconString(const TQString &stationID) TQString WeatherService::iconFileName(const TQString &stationID) { - TQString _name = m_weatherLib->iconName(stationID); - TQString icon = kapp->iconLoader()->iconPath(_name, TDEIcon::Desktop, true); - if( icon.isNull() ) - { - icon = locate( "data", "kweather/" + _name + ".png" ); - } - return icon; + return m_weatherLib->iconPath(stationID); +} + +void WeatherService::useIconTheme(bool use) +{ + kdDebug() << "[!!!] received signal to set useIconTheme to " << use << endl; + WeatherIconPrivate::instance()->useIconTheme(use); +} + +bool WeatherService::usingIconTheme() +{ + return WeatherIconPrivate::instance()->usingIconTheme(); } TQString WeatherService::date(const TQString &stationID) |