~vcs-imports/thunar/trunk

Viewing all changes in revision 4554.

  • Committer: Alexander Schwinn
  • Author(s): Jehan
  • Date: 2018-09-18 20:43:35 UTC
  • Revision ID: git-v1:8349a54d998755f51a4e217f7adddb3445af05a8
Right mouse click will not display icons for custom actions.
(Bug #14685)

g_icon_to_string() is not meant to return an icon name, it returns a
"textual representation of the icon", which is mostly "proprietary to
GIcon" (in GIO documentation's own words).
In particular the reverse function to get a GIcon back from this
representation is g_icon_new_for_string().

The reason why it used to work was because of a special casing (which
happens to be the most common case: when you create an icon with a
single name); yet even if the most common, relying on special cases is a
bad idea. The special case is about to be reinstated in GLib so it will
work again as expected, yet only until the next time a widget uses a not
special-cased GIcon, for instance if using fallback icons. It is better
to really fix the code.

Now the menu properly recreates the icon using g_icon_new_for_string(),
not assuming what type of icons it was (it could be an icon name, a
path, a list of icon names, or whatever else proprietary representation
any type of icon may use now or in the future).
Also update the doc of thunarx_menu_item_new() to explicitly states that
the icon parameter is a textual representation as returned by
g_icon_to_string(). In particular this won't break any plug-ins as
single icon names and icon paths are proper representations for icons
too.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: