From 8db4ab3be8d1c89be219575350441ca8a63b9323 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 3 Sep 2009 12:12:18 -0500 Subject: Moving the checking on the data set on whether we have a name earlier. We don't want to change anything if we've got a name already. Return early. --- libdbusmenu-gtk/client.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 1106e3a..16eae34 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -354,6 +354,14 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, const gc } GtkWidget * gtkimage = gtk_image_menu_item_get_image(GTK_IMAGE_MENU_ITEM(gimi)); + if (!g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON_DATA)) { + /* If we have an image already built from a name that is + way better than a pixbuf. Keep it. */ + if (gtk_image_get_storage_type(GTK_IMAGE(gtkimage)) == GTK_IMAGE_ICON_NAME) { + return; + } + } + /* Now figure out what to change */ if (!g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON)) { const gchar * iconname = dbusmenu_menuitem_property_get(item, property); @@ -396,13 +404,7 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, const gc if (gtkimage == NULL) { gtkimage = gtk_image_new_from_pixbuf(image); } else { - /* If we have an image already built from a name that is - way better than a pixbuf. Keep it. */ - if (gtk_image_get_storage_type(GTK_IMAGE(gtkimage)) != GTK_IMAGE_ICON_NAME) { - gtk_image_set_from_pixbuf(GTK_IMAGE(gtkimage), image); - } else { - g_debug("Blocking icon image data as already set by name."); - } + gtk_image_set_from_pixbuf(GTK_IMAGE(gtkimage), image); } } -- cgit v1.2.3