diff options
author | Ted Gould <ted@gould.cx> | 2010-03-31 17:38:26 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-03-31 17:38:26 -0500 |
commit | 9be2da344aaecbc2a44acb89f94725edaade95f8 (patch) | |
tree | 3e58fa4c76f5bbf3364e1993a6ff4e939d2fdcde /libdbusmenu-glib | |
parent | 8147c935ceef9cbd0dcefee8647b5be9ffc17de9 (diff) | |
parent | 72fe65f2c85436d32d6aab6ecddd03058fc16ba1 (diff) | |
download | libdbusmenu-9be2da344aaecbc2a44acb89f94725edaade95f8.tar.gz libdbusmenu-9be2da344aaecbc2a44acb89f94725edaade95f8.tar.bz2 libdbusmenu-9be2da344aaecbc2a44acb89f94725edaade95f8.zip |
* Upstream Merge
* Changing the parse function to get_children instead of
taking them. (LP: #471044)
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/client.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 09a663a..f5546a2 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -779,7 +779,7 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it xmlNodePtr children; guint position; - GList * oldchildren = dbusmenu_menuitem_take_children(item); + GList * oldchildren = g_list_copy(dbusmenu_menuitem_get_children(item)); /* g_debug("Starting old children: %d", g_list_length(oldchildren)); */ for (children = node->children, position = 0; children != NULL; children = children->next, position++) { @@ -800,8 +800,16 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it } } - childmi = parse_layout_xml(client, children, childmi, item, proxy); - dbusmenu_menuitem_child_add_position(item, childmi, position); + DbusmenuMenuitem * newchildmi = parse_layout_xml(client, children, childmi, item, proxy); + + if (newchildmi != childmi) { + if (childmi != NULL) { + dbusmenu_menuitem_child_delete(item, childmi); + } + dbusmenu_menuitem_child_add_position(item, newchildmi, position); + } else { + dbusmenu_menuitem_child_reorder(item, childmi, position); + } } /* g_debug("Stopping old children: %d", g_list_length(oldchildren)); */ @@ -811,7 +819,7 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it #ifdef MASSIVEDEBUGGING g_debug("Unref'ing menu item with layout update. ID: %d", dbusmenu_menuitem_get_id(oldmi)); #endif - g_object_unref(G_OBJECT(oldmi)); + dbusmenu_menuitem_child_delete(item, oldmi); } g_list_free(oldchildren); |