Created attachment 180496 [details] Screenshot STEPS TO REPRODUCE 1. Add the weather widge to your panel 2. Choose a location 3. Open the widget OBSERVED RESULT The weather report contains columns with two rows of zeros. Its settings shows that no units are pre-selected. EXPECTED RESULT The weather widget chooses meaningful units depending on the region of the user. eg. °F in the US, °C everywhere else SOFTWARE/OS VERSIONS Operating System: Fedora Linux 42 KDE Plasma Version: 6.3.4 KDE Frameworks Version: 6.13.0 Qt Version: 6.9.0 Kernel Version: 6.14.2-300.fc42.x86_64 (64-bit) Graphics Platform: Wayland
I can reproduce it on a newly installed weather applet Can you check if the state with no-units persists if you close the session and log-in back again? (keeping the weather widget in the panel) Thanks!
(In reply to Ismael Asensio from comment #1) > Can you check if the state with no-units persists if you close the session > and log-in back again? (keeping the weather widget in the panel) When logging back in, units are set automatically. :) > Thanks! You are welcome!
(In reply to postix from comment #2) > When logging back in, units are set automatically. :) Nice, thanks for confirming this! It matches what I've been able to debug: for a fresh installed weather applet, the default units are set to the config file at `init()`, but by then the applet is already loaded, and the property object in QML (a KConfigPropertyMap) is not updated to reflect this. Looking for a way to make this update happen, or either, a different way to use the default units without involving the user config
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/749
Git commit 923d22128332a019bfa2893e36c31181bec61a10 by Ismael Asensio. Committed on 22/04/2025 at 21:40. Pushed by iasensio into branch 'master'. applets/weather: Expose and use default units directly In the weather applet we want to have locale-aware default units (ex ºF vs ºC) instead of hardcoded defaults in the config.xml. This was done by writing these defaults into the config if empty. This worked while doing so from the applet constructor, which was wrong and caused other bugs. Setting them in the `init()` method doesn't work either as the applet QML configuration is not correctly updated from config at this point. Instead, let's expose these defaults in the units model and use them as actual fallback values in QML, which should be more robust that messing with the plasma configuration, while also reducing the custom WeatherApplet code. FIXED-IN: 6.3.5 M +4 -4 applets/weather/package/contents/ui/main.qml M +8 -2 applets/weather/plugin/abstractunitlistmodel.cpp M +4 -1 applets/weather/plugin/abstractunitlistmodel.h M +24 -6 applets/weather/plugin/plugin.cpp M +0 -24 applets/weather/weatherapplet.cpp M +0 -4 applets/weather/weatherapplet.h https://invent.kde.org/plasma/kdeplasma-addons/-/commit/923d22128332a019bfa2893e36c31181bec61a10
Git commit b658c27508117bccb1ba0637a79f5c328b6ec7f6 by Ismael Asensio. Committed on 23/04/2025 at 10:39. Pushed by iasensio into branch 'Plasma/6.3'. applets/weather: Expose and use default units directly In the weather applet we want to have locale-aware default units (ex ºF vs ºC) instead of hardcoded defaults in the config.xml. This was done by writing these defaults into the config if empty. This worked while doing so from the applet constructor, which was wrong and caused other bugs. Setting them in the `init()` method doesn't work either as the applet QML configuration is not correctly updated from config at this point. Instead, let's expose these defaults in the units model and use them as actual fallback values in QML, which should be more robust that messing with the plasma configuration, while also reducing the custom WeatherApplet code. FIXED-IN: 6.3.5 (cherry picked from commit 923d22128332a019bfa2893e36c31181bec61a10) Co-authored-by: Ismael Asensio <isma.af@gmail.com> M +4 -4 applets/weather/package/contents/ui/main.qml M +8 -2 applets/weather/plugin/abstractunitlistmodel.cpp M +4 -1 applets/weather/plugin/abstractunitlistmodel.h M +24 -6 applets/weather/plugin/plugin.cpp M +0 -24 applets/weather/weatherapplet.cpp M +0 -4 applets/weather/weatherapplet.h https://invent.kde.org/plasma/kdeplasma-addons/-/commit/b658c27508117bccb1ba0637a79f5c328b6ec7f6