aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-31 14:48:26 -0500
committerTed Gould <ted@gould.cx>2010-03-31 14:48:26 -0500
commitf0e6784840628a41e4fd5e3394d93717e8a21edb (patch)
treed0d852347bce34a144fbc79955bead60dfab5559
parent8147c935ceef9cbd0dcefee8647b5be9ffc17de9 (diff)
parente5c8d4376b81df6c5c9d96e8bb0ba8650f047859 (diff)
downloadlibdbusmenu-f0e6784840628a41e4fd5e3394d93717e8a21edb.tar.gz
libdbusmenu-f0e6784840628a41e4fd5e3394d93717e8a21edb.tar.bz2
libdbusmenu-f0e6784840628a41e4fd5e3394d93717e8a21edb.zip
* Upstream Merge
* Changing the parse function to get_children instead of taking them.
-rw-r--r--debian/changelog8
-rw-r--r--libdbusmenu-glib/client.c16
2 files changed, 20 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog
index e274875..8ab95ac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+libdbusmenu (0.2.8-0ubuntu2~ppa3~update1) UNRELEASED; urgency=low
+
+ * Upstream Merge
+ * Changing the parse function to get_children instead of
+ taking them.
+
+ -- Ted Gould <ted@ubuntu.com> Wed, 31 Mar 2010 14:47:54 -0500
+
libdbusmenu (0.2.8-0ubuntu2~ppa2) lucid; urgency=low
* Upstream merge
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);