Skip to content

Draft: Fix *.rcc loading on Linux, allow for multiple (breeze) *.rcc themes

Julius Künzel requested to merge work/rccLinuxBreeze into master

In KDE Craft we build breeze-icons only with the binary resource (-DBINARY_ICONS_RESOURCE=ON -DSKIP_INSTALL_ICONS=ON). We copy the *.rcc file from either breeze or breeze-dark as icontheme.rcc to a path of QStandartPaths::AppDataLocation. But on Linux QStandartPaths::AppDataLocation always includes <APPNAME> in the path, but we don't know the appname at the time of installing breeze.

Hence we copy it to QStandartPaths::GenericDataLocation instead. This needs to be reflected in KIconTheme otherwise icons are missing in all of the Craft Appimages if breeze is not installed on the host (current situation). So this commits makes sure to use QStandartPaths::AppDataLocation only on Windows and macOS and otherwise QStandartPaths::GenericDataLocation.

However even with this fix there is a limitation since only one icon theme is registered, so this checks also if breeze and/or breeze-dark *.rcc files are available (-DBINARY_ICONS_RESOURCE=ON) while "normal" (*.svg) icons are not (usually because of -DSKIP_INSTALL_ICONS=ON). If so it registers the *.rcc file. This fix is similar to a successful workaround in Kdenlive (multimedia/kdenlive@9a5315d3).

For reference see the breeze-icons blueprint in Craft: https://invent.kde.org/packaging/craft-blueprints-kde/-/blob/master/kde/frameworks/tier1/breeze-icons/breeze-icons.py

Edited by Julius Künzel

Merge request reports