~indicator-applet-developers/indicator-session/trunk.0.1

« back to all changes in this revision

Viewing changes to src/users-service.c

  • Committer: Cody Russell
  • Date: 2009-09-24 21:47:52 UTC
  • mto: This revision was merged to the branch mainline in revision 40.
  • Revision ID: crussell@canonical.com-20090924214752-izovt4e81as2md5m
Clear the menu

Show diffs side-by-side

added added

removed removed

Lines of Context:
158
158
  users_service_dbus_activate_user_session (service, user);
159
159
}
160
160
 
161
 
static void
162
 
remove_menu_item (DbusmenuMenuitem *root, gpointer user_data)
163
 
{
164
 
  DbusmenuMenuitem *child = (DbusmenuMenuitem *)user_data;
165
 
 
166
 
  dbusmenu_menuitem_child_delete (root, child);
167
 
}
168
 
 
169
161
static gint
170
162
compare_users_by_username (const gchar *a,
171
163
                           const gchar *b)
184
176
  GList *u;
185
177
  UserData *user;
186
178
  gboolean can_activate;
 
179
  GList *children;
187
180
 
188
181
  can_activate = users_service_dbus_can_activate_session (service);
189
182
 
190
 
  dbusmenu_menuitem_foreach (root, remove_menu_item, NULL);
 
183
  children = dbusmenu_menuitem_take_children (root);
 
184
  g_list_foreach (children, (GFunc)g_object_unref, NULL);
 
185
  g_list_free (children);
191
186
 
192
187
  mi = dbusmenu_menuitem_new();
193
188
  dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen"));