aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCody Russell <crussell@canonical.com>2009-09-24 16:47:52 -0500
committerCody Russell <crussell@canonical.com>2009-09-24 16:47:52 -0500
commite34203e970f15486db3ff3549496079b470fbfb4 (patch)
treee53d930e14f74c128960ea36468333e6c258e221 /src
parenta77cdfd8eaf9e51bf2a3cccb7d0a2c83b14ef28c (diff)
downloadayatana-indicator-session-e34203e970f15486db3ff3549496079b470fbfb4.tar.gz
ayatana-indicator-session-e34203e970f15486db3ff3549496079b470fbfb4.tar.bz2
ayatana-indicator-session-e34203e970f15486db3ff3549496079b470fbfb4.zip
Clear the menu
Diffstat (limited to 'src')
-rw-r--r--src/users-service-dbus.c8
-rw-r--r--src/users-service.c13
2 files changed, 8 insertions, 13 deletions
diff --git a/src/users-service-dbus.c b/src/users-service-dbus.c
index 018469c..640dfd7 100644
--- a/src/users-service-dbus.c
+++ b/src/users-service-dbus.c
@@ -46,10 +46,10 @@ static gchar *get_seat (UsersServiceDbus *servic
static void users_loaded (DBusGProxy *proxy,
gpointer user_data);
static void user_added (DBusGProxy *proxy,
- guint uid,
+ gint64 uid,
gpointer user_data);
static void user_removed (DBusGProxy *proxy,
- guint uid,
+ gint64 uid,
gpointer user_data);
static void user_updated (DBusGProxy *proxy,
guint uid,
@@ -916,7 +916,7 @@ start_new_user_session (UsersServiceDbus *self,
static void
user_added (DBusGProxy *proxy,
- guint uid,
+ gint64 uid,
gpointer user_data)
{
UsersServiceDbus *service = (UsersServiceDbus *)user_data;
@@ -972,7 +972,7 @@ compare_users_by_uid (gpointer key,
static void
user_removed (DBusGProxy *proxy,
- guint uid,
+ gint64 uid,
gpointer user_data)
{
UsersServiceDbus *service = (UsersServiceDbus *)user_data;
diff --git a/src/users-service.c b/src/users-service.c
index 9ebf5f5..96ee3ba 100644
--- a/src/users-service.c
+++ b/src/users-service.c
@@ -158,14 +158,6 @@ activate_user_session (DbusmenuMenuitem *mi, gpointer user_data)
users_service_dbus_activate_user_session (service, user);
}
-static void
-remove_menu_item (DbusmenuMenuitem *root, gpointer user_data)
-{
- DbusmenuMenuitem *child = (DbusmenuMenuitem *)user_data;
-
- dbusmenu_menuitem_child_delete (root, child);
-}
-
static gint
compare_users_by_username (const gchar *a,
const gchar *b)
@@ -184,10 +176,13 @@ rebuild_items (DbusmenuMenuitem *root,
GList *u;
UserData *user;
gboolean can_activate;
+ GList *children;
can_activate = users_service_dbus_can_activate_session (service);
- dbusmenu_menuitem_foreach (root, remove_menu_item, NULL);
+ children = dbusmenu_menuitem_take_children (root);
+ g_list_foreach (children, (GFunc)g_object_unref, NULL);
+ g_list_free (children);
mi = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen"));