applets/weather: Fix behavior of the fallback icon utility

This MR includes two fixes for the Util::existingWeatherIconNames() method, which is used to validate and improve the Plasmoid.icon used in the panel and the tray, but in some edge cases was failing to do so.

applets/weather: Fix typo on fallback icon name

This would produce an unknown icon instead of the weather fallback we are looking for

applets/weather: Fix icon fallback by removing custom helper

This utility method was designed to give a custom fallback instead of
the general "unknown" icon". But in doing so, it would fail to find
the theme fallbacks according to the freedesktop spec.

Let's instead use the mechanisms that KF6 already provide:

  • The KIconLoader code can find the appropriate icon or fallback and
    even respects the -symbolic suffixes.
  • If no icon or fallback is found in the current theme, the fallback
    property on  Kirigami.Icon will set the custom unknown icon we want
    Provide this unknown icon name as a property to avoid eventual typos.

Testing

The case is triggered for an icon name which is not found in the current theme, but possibly a fallback of it may.

I've forced it to simplify testing and because breeze has every icon we use.
For an input icon name of weather-showers-fake we get:

BEFORE Fix Typo Fix Fallback
weather-not-available-symbolic weather-none-available-symbolic weather-showers-symbolic
weather-icon-before weather-icon-fix1 weather-icon-fix2

Cherry-picking

For ease of mind I'd cherry-pick just the typo fix to stable.

The second bug case will likely not happen when using the official breeze icon theme, and there are no open bug reports addressing this (IIRC we had one but thought at the moment it was just an issue with the upstream icon theme). I think https://bugs.kde.org/show_bug.cgi?id=515779 is a slightly different issue

Edited by Ismael Asensio

Merge request reports

Loading