diff options
Diffstat (limited to 'gtk/src/icons.c')
-rw-r--r-- | gtk/src/icons.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk/src/icons.c b/gtk/src/icons.c index a99deba03..042525592 100644 --- a/gtk/src/icons.c +++ b/gtk/src/icons.c @@ -7,7 +7,7 @@ void ghb_load_icons() { GHashTableIter iter; - gchar *name; + gchar *key; GValue *gval; GValue *icons = ghb_resource_get("icons"); @@ -15,13 +15,19 @@ ghb_load_icons() // middle (void*) cast prevents gcc warning "defreferencing type-punned // pointer will break strict-aliasing rules" while (g_hash_table_iter_next( - &iter, (gpointer*)(void*)&name, (gpointer*)(void*)&gval)) + &iter, (gpointer*)(void*)&key, (gpointer*)(void*)&gval)) { gint colorspace, bps, width, height, rowstride; gboolean alpha; ghb_rawdata_t *rd; gint size; GdkPixbuf *pb; + char *name = g_strdup(key); + char *pos; + + pos = g_strstr_len(name, -1, "."); + if (pos != NULL) + *pos = '\0'; colorspace = ghb_value_int(ghb_dict_lookup(gval, "colorspace")); alpha = ghb_value_boolean(ghb_dict_lookup(gval, "alpha")); @@ -37,5 +43,6 @@ ghb_load_icons() size = gdk_pixbuf_get_height(pb); gtk_icon_theme_add_builtin_icon(name, size, pb); g_object_unref(pb); + g_free(name); } } |