aboutsummaryrefslogtreecommitdiff
path: root/src/users-service.c
diff options
context:
space:
mode:
authorCody Russell <crussell@canonical.com>2009-09-24 11:25:58 -0500
committerCody Russell <crussell@canonical.com>2009-09-24 11:25:58 -0500
commit73f4d4e7e1c6a5db370848797923481a7ee4ef43 (patch)
treebfb93041d346a52edb0018a8474b16c23379ff05 /src/users-service.c
parent62f44cf97e38da112c70afeb8545d87042d251e2 (diff)
downloadayatana-indicator-session-73f4d4e7e1c6a5db370848797923481a7ee4ef43.tar.gz
ayatana-indicator-session-73f4d4e7e1c6a5db370848797923481a7ee4ef43.tar.bz2
ayatana-indicator-session-73f4d4e7e1c6a5db370848797923481a7ee4ef43.zip
Don't check range twice here
Diffstat (limited to 'src/users-service.c')
-rw-r--r--src/users-service.c21
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))