aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib/server.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-05 10:54:42 -0800
committerTed Gould <ted@gould.cx>2010-02-05 10:54:42 -0800
commit873763b18e85fe2d53f847e00d5207e4926bb619 (patch)
tree833014e2b5bea30c53b5e3660e3a47180be1faa8 /libdbusmenu-glib/server.c
parenta207ebb4db1921fe122a9c78b97f17e7ec175a29 (diff)
parent0f6f4c9cdd83d80dfd77fbedcc9a9468cb16eaae (diff)
downloadlibdbusmenu-873763b18e85fe2d53f847e00d5207e4926bb619.tar.gz
libdbusmenu-873763b18e85fe2d53f847e00d5207e4926bb619.tar.bz2
libdbusmenu-873763b18e85fe2d53f847e00d5207e4926bb619.zip
Fix IDs to handle the root ID of zero better and to handle merging of properties if items are reused.
Diffstat (limited to 'libdbusmenu-glib/server.c')
-rw-r--r--libdbusmenu-glib/server.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c
index 7d8e5c3..f8267c2 100644
--- a/libdbusmenu-glib/server.c
+++ b/libdbusmenu-glib/server.c
@@ -237,12 +237,14 @@ set_property (GObject * obj, guint id, const GValue * value, GParamSpec * pspec)
case PROP_ROOT_NODE:
if (priv->root != NULL) {
dbusmenu_menuitem_foreach(priv->root, menuitem_signals_remove, obj);
+ dbusmenu_menuitem_set_root(priv->root, FALSE);
g_object_unref(G_OBJECT(priv->root));
priv->root = NULL;
}
priv->root = DBUSMENU_MENUITEM(g_value_get_object(value));
if (priv->root != NULL) {
g_object_ref(G_OBJECT(priv->root));
+ dbusmenu_menuitem_set_root(priv->root, TRUE);
dbusmenu_menuitem_foreach(priv->root, menuitem_signals_create, obj);
} else {
g_debug("Setting root node to NULL");
@@ -516,7 +518,7 @@ static gboolean
_dbusmenu_server_get_children (DbusmenuServer * server, gint id, GPtrArray * properties, GPtrArray ** output, GError ** error)
{
DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server);
- DbusmenuMenuitem * mi = id == 0 ? priv->root : dbusmenu_menuitem_find_id(priv->root, id);
+ DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id);
if (mi == NULL) {
if (error != NULL) {