diff options
author | Ted Gould <ted@canonical.com> | 2009-09-24 15:53:33 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-09-24 15:53:33 -0500 |
commit | 498c1fbc2f7956e3434cdf174f40754e4a261df3 (patch) | |
tree | eef6b2b4329043f2d782f6611acac9f55753c440 /libdbusmenu-glib/menuitem.c | |
parent | c699131fa96f6f48bf2509b46beb256cf04b2d82 (diff) | |
parent | 152034b24234c6d06649a48ae29643c5075c4bb1 (diff) | |
download | libdbusmenu-498c1fbc2f7956e3434cdf174f40754e4a261df3.tar.gz libdbusmenu-498c1fbc2f7956e3434cdf174f40754e4a261df3.tar.bz2 libdbusmenu-498c1fbc2f7956e3434cdf174f40754e4a261df3.zip |
Merging in the branch adding a revision number to layouts to ensure they're in sync.
Diffstat (limited to 'libdbusmenu-glib/menuitem.c')
-rw-r--r-- | libdbusmenu-glib/menuitem.c | 10 |
1 files changed, 6 insertions, 4 deletions
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("<menu id=\"%d\" />", dbusmenu_menuitem_get_id(mi))); + g_ptr_array_add(array, g_strdup_printf("<menu id=\"%d\" revision=\"%d\" />", dbusmenu_menuitem_get_id(mi), revision)); } else { - g_ptr_array_add(array, g_strdup_printf("<menu id=\"%d\">", dbusmenu_menuitem_get_id(mi))); + g_ptr_array_add(array, g_strdup_printf("<menu id=\"%d\" revision=\"%d\">", 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("</menu>")); } |