From ade76d21e26083ebd287564c321ee3a7600d1fe4 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 1 Oct 2009 15:34:26 -0500 Subject: Leaving abstract the data as long as possible to avoid GTK cast warnings. --- libdbusmenu-gtk/client.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 35f5e61..21da38e 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -324,14 +324,13 @@ dbusmenu_gtkclient_menuitem_get (DbusmenuGtkClient * client, DbusmenuMenuitem * g_return_val_if_fail(DBUSMENU_IS_GTKCLIENT(client), NULL); g_return_val_if_fail(DBUSMENU_IS_MENUITEM(item), NULL); - GtkMenuItem * mi = GTK_MENU_ITEM(g_object_get_data(G_OBJECT(item), data_menuitem)); - if (mi == NULL) { - // new_menuitem(DBUSMENU_CLIENT(client), item, NULL); + gpointer data = g_object_get_data(G_OBJECT(item), data_menuitem); + if (data == NULL) { g_warning("GTK not updated"); - mi = GTK_MENU_ITEM(g_object_get_data(G_OBJECT(item), data_menuitem)); + return NULL; } - return mi; + return GTK_MENU_ITEM(data); } /* The base type handler that builds a plain ol' -- cgit v1.2.3