aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-09-03 12:12:18 -0500
committerTed Gould <ted@canonical.com>2009-09-03 12:12:18 -0500
commit8db4ab3be8d1c89be219575350441ca8a63b9323 (patch)
tree9a4081d5b1dd6d1fbef7ba2ccbd67e14da021df4
parent299c398f84aa427600aa5a6ade9fb84ee6cf49be (diff)
downloadlibdbusmenu-8db4ab3be8d1c89be219575350441ca8a63b9323.tar.gz
libdbusmenu-8db4ab3be8d1c89be219575350441ca8a63b9323.tar.bz2
libdbusmenu-8db4ab3be8d1c89be219575350441ca8a63b9323.zip
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.
-rw-r--r--libdbusmenu-gtk/client.c16
1 files 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);
}
}