aboutsummaryrefslogtreecommitdiff
path: root/src/user-menu-mgr.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-06-03 16:00:36 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-06-03 16:00:36 -0500
commite558988446e4a57e9763e69dd40935a24258c72f (patch)
treed088a1fe71c4fd3a48734a9fae5cc084bc8996bf /src/user-menu-mgr.c
parent836670699384e59663080499b3914070c4413cf0 (diff)
downloadayatana-indicator-session-e558988446e4a57e9763e69dd40935a24258c72f.tar.gz
ayatana-indicator-session-e558988446e4a57e9763e69dd40935a24258c72f.tar.bz2
ayatana-indicator-session-e558988446e4a57e9763e69dd40935a24258c72f.zip
user_count is a one-time use variable, so reduce its scope from being a UserMenuMgr field to a temporary var in user_menu_mgr_rebuild_items()
Diffstat (limited to 'src/user-menu-mgr.c')
-rw-r--r--src/user-menu-mgr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c
index 8e1a38d..7846f2e 100644
--- a/src/user-menu-mgr.c
+++ b/src/user-menu-mgr.c
@@ -36,7 +36,6 @@ struct _UserMenuMgr
GObject parent_instance;
UsersServiceDbus* users_dbus_interface;
DbusmenuMenuitem* root_item;
- gint user_count;
SessionDbus* session_dbus_interface;
GSettings * lockdown_settings;
};
@@ -180,7 +179,7 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode)
gboolean guest_enabled = users_service_dbus_guest_session_enabled (self->users_dbus_interface);
GList * users = NULL;
users = users_service_dbus_get_user_list (self->users_dbus_interface);
- self->user_count = g_list_length(users);
+ const gint user_count = g_list_length(users);
gboolean gsettings_user_menu_is_visible = should_show_user_menu();
@@ -191,7 +190,7 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode)
else{
// This needs to be updated once the ability to query guest session support is available
session_dbus_set_user_menu_visibility (self->session_dbus_interface,
- guest_enabled || self->user_count > 1);
+ guest_enabled || user_count > 1);
}
// TODO we should really return here if the menu is not going to be shown.