Skip to content

Icon theme deployment on Windows, Mac OS and mobile platforms

Thursday, 16 June 2016  |  David Faure

During the Randa meeting I implemented some magic in KIconThemes to generalize a design initially made by Christoph Cullmann for Kate.

On platforms other than Linux/BSD, icon themes are not available as part of the system, and installing 6235 files takes forever. The deployment strategy for applications on those operations systems is now the following:

  • breeze-icons (and in the future other icon themes, probably), when configured with -DBINARY_ICONS_RESOURCE=ON, installs .rcc files (binary resources, loadable by Qt).
  • The installation process copies one of these under the name "icontheme.rcc", in a directory found by QStandardPaths::AppDataLocation. For instance on Windows, icontheme.rcc is usually installed in APPROOT\data\, while on Mac OS it is installed in the Resources directory inside the application bundle.
  • As long as the application links to KIconThemes (even if it doesn't use any of its API), the icontheme.rcc file will be found on startup, loaded, and set as the default icon theme.

Therefore, no code modification is needed in KDE applications, to make them find an icon theme from a rcc file, it's just a matter of packaging the desired theme into the right location. And the users can even swap that with another theme rcc file easily if they want to.

The official long-term version of this explanation is available in the KIconThemes API documentation.