diff options
Diffstat (limited to 'src/users-service.c')
-rw-r--r-- | src/users-service.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/users-service.c b/src/users-service.c index 51c6c5d..9ebf5f5 100644 --- a/src/users-service.c +++ b/src/users-service.c @@ -204,25 +204,22 @@ rebuild_items (DbusmenuMenuitem *root, g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_guest_session), NULL); } - if (count > 1 && count < 7) + if (count > MINIMUM_USERS && count < MAXIMUM_USERS) { - if (count > MINIMUM_USERS && count < MAXIMUM_USERS) + if (users != NULL) { - if (users != NULL) - { - GList *l = NULL; - - for (l = users; l != NULL; l = l->next) - { - users = g_list_delete_link (users, l); - } + GList *l = NULL; - users = NULL; + for (l = users; l != NULL; l = l->next) + { + users = g_list_delete_link (users, l); } - users = users_service_dbus_get_user_list (service); + users = NULL; } + users = users_service_dbus_get_user_list (service); + users = g_list_sort (users, (GCompareFunc)compare_users_by_username); for (u = users; u != NULL; u = g_list_next (u)) |