From b8c1eb0bf8b17d703fa8fea3e2c68bac6a7fee61 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 21 Sep 2009 15:01:40 -0500 Subject: Putting the revision number into the XML sent across the bus. --- libdbusmenu-glib/menuitem.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libdbusmenu-glib/menuitem.c') diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index 41c48e2..0c44e3c 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -806,6 +806,7 @@ dbusmenu_menuitem_get_root (DbusmenuMenuitem * mi) dbusmenu_menuitem_buildxml: @mi: #DbusmenuMenuitem to represent in XML @array: A list of string that will be turned into an XML file + @revision: The revision of the layout to embed in the XML This function will add strings to the array @array. It will put at least one entry if this menu item has no children. If it has @@ -814,17 +815,18 @@ dbusmenu_menuitem_get_root (DbusmenuMenuitem * mi) children to place their own tags in the array in between those two. */ void -dbusmenu_menuitem_buildxml (DbusmenuMenuitem * mi, GPtrArray * array) +dbusmenu_menuitem_buildxml (DbusmenuMenuitem * mi, GPtrArray * array, gint revision) { g_return_if_fail(DBUSMENU_IS_MENUITEM(mi)); GList * children = dbusmenu_menuitem_get_children(mi); + /* TODO: Only put revision info in the root node. Save some bandwidth. */ if (children == NULL) { - g_ptr_array_add(array, g_strdup_printf("", dbusmenu_menuitem_get_id(mi))); + g_ptr_array_add(array, g_strdup_printf("", dbusmenu_menuitem_get_id(mi), revision)); } else { - g_ptr_array_add(array, g_strdup_printf("", dbusmenu_menuitem_get_id(mi))); + g_ptr_array_add(array, g_strdup_printf("", dbusmenu_menuitem_get_id(mi), revision)); for ( ; children != NULL; children = children->next) { - dbusmenu_menuitem_buildxml(DBUSMENU_MENUITEM(children->data), array); + dbusmenu_menuitem_buildxml(DBUSMENU_MENUITEM(children->data), array, revision); } g_ptr_array_add(array, g_strdup("")); } -- cgit v1.2.3