diff options
author | Ted Gould <ted@gould.cx> | 2010-03-02 11:46:27 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-03-02 11:46:27 -0600 |
commit | 206f1003cad828ca2465088ea3fbf73b1a6a4c97 (patch) | |
tree | 4f45c8e429809357afd6077421c1745f76dcb680 | |
parent | 86a394ae84f4c09c0bfc7b7136bcc7e88ca04bc5 (diff) | |
download | ayatana-indicator-session-206f1003cad828ca2465088ea3fbf73b1a6a4c97.tar.gz ayatana-indicator-session-206f1003cad828ca2465088ea3fbf73b1a6a4c97.tar.bz2 ayatana-indicator-session-206f1003cad828ca2465088ea3fbf73b1a6a4c97.zip |
Making it so that users is not a global and just grabbed everytime and used.
-rw-r--r-- | src/session-service.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/session-service.c b/src/session-service.c index a2760d1..eeb88a9 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -69,7 +69,6 @@ static DbusmenuMenuitem *lock_menuitem = NULL; static DbusmenuMenuitem *switch_menuitem = NULL; static gint count; -static GList *users; static DbusmenuMenuitem * root_menuitem = NULL; static GMainLoop * mainloop = NULL; @@ -472,22 +471,11 @@ rebuild_items (DbusmenuMenuitem *root, } } + GList * users = NULL; + users = users_service_dbus_get_user_list (service); + if (count > MINIMUM_USERS && count < MAXIMUM_USERS) { - if (users != NULL) - { - GList *l = NULL; - - for (l = users; l != NULL; l = l->next) - { - users = g_list_delete_link (users, l); - } - - 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)) @@ -509,6 +497,8 @@ rebuild_items (DbusmenuMenuitem *root, g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_user_session), user); } } + + g_list_free(users); } DbusmenuMenuitem * separator = dbusmenu_menuitem_new(); |