Comment 9 for bug 1509562

Trogel (trogel) wrote :

My impression is that the affected KDE applications now rely on Qt5's QIcon::fromTheme(...) to locate the icons. This is in line with the documentation of KIconLoader::loadIconSet(...) (from source package kiconthemes_5.15.0-0ubuntu1) that says: "@deprecated use QIcon::fromTheme instead, which uses the iconloader internally".

But it seems that Qt5 only supports the very basic 'hicolor' icon theme when not running in a KDE or Gnome session. The method themeHint(ThemeHint hint) of the classes QKdeTheme and QGnomeTheme support the hint QPlatformTheme::SystemIconThemeName, whereas the implementation of this method for the class QGenericUnixTheme does not support that hint (soruce package qtbase-opensource-src_5.4.2+dfsg-2ubuntu9, file src/platformsupport/themes/genericunix/qgenericunixthemes.cpp). Therefore, I assume, the systems falls back to the fallback theme 'hicolor' using the hint QPlatformTheme::SystemIconFallbackThemeName. It seems that 'hicolor' lacks of most icons needed by kate and the other applications.

So it possibly requires a change in Qt5 rather than in specific KDE applications or the KDE framework to get the icons back in these applications when running in Xfce.

For a test (and as a rather dirty workaround) I have moved /usr/share/icons/hicolor out of the way and replaced it with a symlink to some other icon theme like 'oxygen' or 'elementary-xfce-darker'. For example:

$ cd /usr/share/icons
$ sudo mv hicolor/ hicolor-bkp
$ sudo ln -s elementary-xfce-darker hicolor

Then I started kate, konsole, and dolphin manually from a terminal window and they had most or even all of the missing icons back. When started them from a launcher (from the panel in my case), the icons were still missing. Now, after a fresh login to Xubuntu, the affected applications have most or all of the missing icons, regardless of the way I start them.

On the downside, now some other icons are missing. For instance, the application icons of konqueror, kate, and other KDE applications are missing in the launchers and in the Whisker Menu. But for the time being I prefer to have a usable kate and happily accept some missing application icons.