diff options
author | Jehan <jehan@girinstud.io> | 2018-06-07 16:16:02 +0200 |
---|---|---|
committer | Jehan <jehan@girinstud.io> | 2018-06-08 04:16:15 +0200 |
commit | 5fb6d788a51466a884d36a607c7cf7716b5dccc7 (patch) | |
tree | 9bbde5d4e87da716f30aab2e460e642e9a7a0545 /gio/gthemedicon.c | |
parent | 9290044265308f4acee1c9981b35648750fc4862 (diff) | |
download | glib-5fb6d788a51466a884d36a607c7cf7716b5dccc7.tar.gz |
gio: do not add an icon name already in the list.
This may happen when creating an icon with several icon name whereas one
is already a variant of a previous one.
Diffstat (limited to 'gio/gthemedicon.c')
-rw-r--r-- | gio/gthemedicon.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gio/gthemedicon.c b/gio/gthemedicon.c index da371b22d..9c0ff9e3e 100644 --- a/gio/gthemedicon.c +++ b/gio/gthemedicon.c @@ -156,6 +156,12 @@ g_themed_icon_constructed (GObject *object) gchar *name; gboolean is_symbolic; + if (g_list_find_custom (names, themed->names[i], (GCompareFunc) g_strcmp0) || + g_list_find_custom (variants, themed->names[i], (GCompareFunc) g_strcmp0)) + /* The icon name was already added and is higher in priority. + * There is no need to re-add it. */ + continue; + is_symbolic = g_str_has_suffix (themed->names[i], "-symbolic"); if (is_symbolic) { |