From ee4d58a3a1a25f1264df9c9732a480e1f436790f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 30 Jun 2009 23:56:13 -0500 Subject: Moving the server to after the items makes things work better, but I'm curious why it's failing. This is more a test for dbusmenu though which'll have better debug. --- src/users-service.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/users-service.c b/src/users-service.c index c3c842f..409a1d0 100644 --- a/src/users-service.c +++ b/src/users-service.c @@ -14,13 +14,18 @@ gchar * dummies[] = { "Bob", "Jim", "Alvin", "Mary", NULL }; -void dummy_users (void) { +static void +dummy_users (DbusmenuMenuitem * root) { int count; for (count = 0; dummies[count] != NULL; count++) { DbusmenuMenuitem * mi = dbusmenu_menuitem_new(); + g_debug("Creating item: %d %s", dbusmenu_menuitem_get_id(mi), dummies[count]); + g_debug("\tRoot ID: %d", dbusmenu_menuitem_get_id(root)); dbusmenu_menuitem_property_set(mi, "label", dummies[count]); - dbusmenu_menuitem_child_append(root_menuitem, mi); + dbusmenu_menuitem_child_add_position(root, mi, count); } + + return; } int @@ -44,6 +49,10 @@ main (int argc, char ** argv) } root_menuitem = dbusmenu_menuitem_new(); + g_debug("Root ID: %d", dbusmenu_menuitem_get_id(root_menuitem)); + + dummy_users(root_menuitem); + DbusmenuServer * server = dbusmenu_server_new(INDICATOR_USERS_DBUS_OBJECT); dbusmenu_server_set_root(server, root_menuitem); -- cgit v1.2.3