diff options
author | Ted Gould <ted@gould.cx> | 2010-07-20 15:04:40 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-07-20 15:04:40 -0500 |
commit | 464535d5f3482e0ff08834a79512ce04dfd5883e (patch) | |
tree | 5d34467f5ef522b4f9c1909e187c16bebd171280 | |
parent | 25fa88e0f02624887022ff78e987fecfadb8ffaf (diff) | |
download | libdbusmenu-464535d5f3482e0ff08834a79512ce04dfd5883e.tar.gz libdbusmenu-464535d5f3482e0ff08834a79512ce04dfd5883e.tar.bz2 libdbusmenu-464535d5f3482e0ff08834a79512ce04dfd5883e.zip |
Move the parse to the end and make it dual pass through the list of children.
-rw-r--r-- | libdbusmenu-glib/client.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 67c5354..078b6ad 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1124,8 +1124,6 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it dbusmenu_menuitem_child_reorder(item, childmi, position); parse_layout_update(childmi, client); } - - parse_layout_xml(client, children, childmi, item, proxy); } /* g_debug("Stopping old children: %d", g_list_length(oldchildren)); */ @@ -1139,6 +1137,23 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it } g_list_free(oldchildren); + /* We've got everything built up at this node and reconcilled */ + /* now it's time to recurse down the tree. */ + children = node->children; + GList * childmis = dbusmenu_menuitem_get_children(item); + while (children != NULL && childmis != NULL) { + parse_layout_xml(client, children, DBUSMENU_MENUITEM(childmis->data), item, proxy); + + children = children->next; + childmis = g_list_next(childmis); + } + if (children != NULL) { + g_warning("Sync failed, now we've got extra XML nodes."); + } + if (childmis != NULL) { + g_warning("Sync failed, now we've got extra menu items."); + } + return item; } |