summaryrefslogtreecommitdiff
path: root/gio/gthemedicon.c
diff options
context:
space:
mode:
authorOlivier Brunel <jjk@jjacky.com>2013-10-08 16:11:44 +0200
committerMatthias Clasen <mclasen@redhat.com>2013-10-24 08:09:48 -0400
commit0a7d1084a5917815eef34cf9a0bc2d140fcaa190 (patch)
tree1a324d6a1b2b429b27c5799fa94994adcf8461f5 /gio/gthemedicon.c
parent1e1e2d1ff7debb3941a8841c4ec501dbd6edd1fd (diff)
downloadglib-0a7d1084a5917815eef34cf9a0bc2d140fcaa190.tar.gz
gthemedicon: Fallback to non-symbolic icons
When doing fallback for symbolic icons, we first shorten the name at dashes while preserving the -symbolic suffix. But after exhausting that, we should also try stripping the suffix. See https://bugzilla.gnome.org/show_bug.cgi?id=708163 Signed-off-by: Olivier Brunel <jjk@jjacky.com> https://bugzilla.gnome.org/show_bug.cgi?id=710254
Diffstat (limited to 'gio/gthemedicon.c')
-rw-r--r--gio/gthemedicon.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gio/gthemedicon.c b/gio/gthemedicon.c
index 1c3d41814..ba658fabc 100644
--- a/gio/gthemedicon.c
+++ b/gio/gthemedicon.c
@@ -187,12 +187,15 @@ g_themed_icon_constructed (GObject *object)
if (is_symbolic)
{
- themed->names = g_new (char *, dashes + 1 + 1);
+ themed->names = g_new (char *, 2 * dashes + 3);
for (i = 0; names[i] != NULL; i++)
- themed->names[i] = g_strconcat (names[i], "-symbolic", NULL);
+ {
+ themed->names[i] = g_strconcat (names[i], "-symbolic", NULL);
+ themed->names[dashes + 1 + i] = names[i];
+ }
- themed->names[i] = NULL;
- g_strfreev (names);
+ themed->names[dashes + 1 + i] = NULL;
+ g_free (names);
}
else
{