Improve error message about why IconTheme fails to find an icon
Calling Gtk.IconTheme.get_default().load_icon("org.pitivi.Pitivi", 256, Gtk.IconLookupFlags.FORCE_SIZE)
fails with the following error:
gi.repository.GLib.Error: gtk-icon-theme-error-quark: Icon 'org.pitivi.Pitivi' not present in theme Adwaita (0)
The app installed its icon in hicolor, as per the instructions in https://developer.gnome.org/gtk3/stable/GtkIconTheme.html:
The operation of icon themes on Linux and Unix follows the Icon Theme Specification. There is a fallback icon theme, named hicolor, where applications should install their icons, but additional icon themes can be installed as operating system vendors and users choose.
The icon started to be available to Gtk.IconTheme only after gtk-update-icon-cache /share/icons/hicolor
has been run. As it's very difficult to figure this out, we should:
-
Update the IconTheme documentation to specify that it's looking for icons only in the
icon-theme.cache
files prepared by gtk-update-icon-cache in the subdirectories for each icon theme. -
Update the "Icon 'org.pitivi.Pitivi' not present in theme Adwaita" error message to something like "Icon 'org.pitivi.Pitivi' not present in the caches for theme Adwaita or fallback theme hicolor"