From 58da23cc6cb256459fccc72092b2e4aa8ca82174 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 13 May 2011 08:14:04 -0500 Subject: Adding the element type to get_children --- libdbusmenu-glib/menuitem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libdbusmenu-glib/menuitem.c') diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index bdaf49f..9c1d30a 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -575,7 +575,7 @@ dbusmenu_menuitem_set_realized (DbusmenuMenuitem * mi) * has. The list is valid until another child related function * is called, where it might be changed. * - * Return value: (transfer none): A #GList of pointers to #DbusmenuMenuitem objects. + * Return value: (transfer none) (element-type Dbusmenu.Menuitem): A #GList of pointers to #DbusmenuMenuitem objects. */ GList * dbusmenu_menuitem_get_children (DbusmenuMenuitem * mi) -- cgit v1.2.3 From 2578c3858e862553b07bf106c32d8db0d3645ea0 Mon Sep 17 00:00:00 2001 From: Jonathan Landis Date: Thu, 16 Jun 2011 22:25:56 -0500 Subject: Fix for several issues as documented in bug 784890 --- libdbusmenu-glib/menuitem.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'libdbusmenu-glib/menuitem.c') diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index bdaf49f..e07fc37 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -1694,25 +1694,20 @@ dbusmenu_menuitem_handle_event (DbusmenuMenuitem * mi, const gchar * name, GVari #endif DbusmenuMenuitemClass * class = DBUSMENU_MENUITEM_GET_CLASS(mi); - /* We need to keep a ref to the variant because the signal - handler will drop the floating ref and then we'll be up - a creek if we don't have our own later. */ - if (variant != NULL) { - g_variant_ref_sink(variant); + gboolean handled = FALSE; + if (variant == NULL) { + variant = g_variant_new("i", 0); } - gboolean handled = FALSE; + g_variant_ref_sink(variant); + g_signal_emit(G_OBJECT(mi), signals[EVENT], g_quark_from_string(name), name, variant, timestamp, &handled); if (!handled && class->handle_event != NULL) { class->handle_event(mi, name, variant, timestamp); } - if (variant != NULL) { - g_variant_unref(variant); - } - - return; + g_variant_unref(variant); } /** -- cgit v1.2.3 From 2960e028e98163a9932a8e47940ce12032c55af5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 16 Jun 2011 22:33:51 -0500 Subject: Avoid string parsing by using a direct variant new function. --- libdbusmenu-glib/menuitem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libdbusmenu-glib/menuitem.c') diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index e07fc37..525c519 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -1696,7 +1696,7 @@ dbusmenu_menuitem_handle_event (DbusmenuMenuitem * mi, const gchar * name, GVari gboolean handled = FALSE; if (variant == NULL) { - variant = g_variant_new("i", 0); + variant = g_variant_new_int32(0); } g_variant_ref_sink(variant); -- cgit v1.2.3