diff options
-rw-r--r-- | debian/changelog | 9 | ||||
-rw-r--r-- | libdbusmenu-glib/client.c | 2 | ||||
-rw-r--r-- | libdbusmenu-gtk/parser.c | 22 |
3 files changed, 27 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog index d0100c4..f78b9c3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +libdbusmenu (0.3.93-0ubuntu2~ted4) UNRELEASED; urgency=low + + * Upstream Merge + * Look for the serializable menuitems and use their + build functions + * Fix critical message from being printed + + -- Ted Gould <ted@ubuntu.com> Tue, 25 Jan 2011 16:53:09 -0600 + libdbusmenu (0.3.93-0ubuntu2~ted3) natty; urgency=low * Upstream Merge diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index ea0f0f7..a25ad79 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1451,7 +1451,7 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it /* We've got everything built up at this node and reconcilled */ /* Flush the properties requests if this is the first level */ - if (dbusmenu_menuitem_get_id(parent) == 0) { + if (parent != NULL && dbusmenu_menuitem_get_id(parent) == 0) { get_properties_flush(client); } diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index d26f8fb..6d95f10 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -28,6 +28,7 @@ License version 3 and version 2.1 along with this program. If not, see #include "parser.h" #include "menuitem.h" +#include "serializablemenuitem.h" #define CACHED_MENUITEM "dbusmenu-gtk-parser-cached-item" @@ -240,13 +241,23 @@ parse_menu_structure_helper (GtkWidget * widget, RecurseContext * recurse) } } +/* Turn a widget into a dbusmenu item depending on the type of GTK + object that it is. */ static DbusmenuMenuitem * construct_dbusmenu_for_widget (GtkWidget * widget) { - DbusmenuMenuitem *mi = dbusmenu_menuitem_new (); - + /* If it's a subclass of our serializable menu item then we can + use its own build function */ + if (DBUSMENU_IS_GTK_SERIALIZABLE_MENU_ITEM(widget)) { + DbusmenuGtkSerializableMenuItem * smi = DBUSMENU_GTK_SERIALIZABLE_MENU_ITEM(widget); + return dbusmenu_gtk_serializable_menu_item_build_dbusmenu_menuitem(smi); + } + + /* If it's a standard GTK Menu Item we need to do some of our own work */ if (GTK_IS_MENU_ITEM (widget)) { + DbusmenuMenuitem *mi = dbusmenu_menuitem_new (); + gboolean visible = FALSE; gboolean sensitive = FALSE; if (GTK_IS_SEPARATOR_MENU_ITEM (widget)) @@ -379,11 +390,12 @@ construct_dbusmenu_for_widget (GtkWidget * widget) "notify", G_CALLBACK (widget_notify_cb), mi); + return mi; } - return mi; - - return NULL; + /* If it's none of those we're going to just create a + generic menuitem as a place holder for it. */ + return dbusmenu_menuitem_new(); } static void |