aboutsummaryrefslogtreecommitdiff
path: root/src/device-menu-mgr.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-06-05 14:37:22 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-06-05 14:37:22 -0500
commit86f0c074a99880ab8d4cc146ab17a8e9ac90c667 (patch)
tree5a93eb71d48e5454c4e324d2741e093e3ebcb1e1 /src/device-menu-mgr.c
parent6d597642dbdea6af69f2cc1329e8659cc722908e (diff)
downloadayatana-indicator-session-86f0c074a99880ab8d4cc146ab17a8e9ac90c667.tar.gz
ayatana-indicator-session-86f0c074a99880ab8d4cc146ab17a8e9ac90c667.tar.bz2
ayatana-indicator-session-86f0c074a99880ab8d4cc146ab17a8e9ac90c667.zip
reduce the scope of another formerly global variable: system_settings_menuitem
Diffstat (limited to 'src/device-menu-mgr.c')
-rw-r--r--src/device-menu-mgr.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c
index f3c9f85..762ec8a 100644
--- a/src/device-menu-mgr.c
+++ b/src/device-menu-mgr.c
@@ -56,7 +56,6 @@ struct _DeviceMenuMgr
};
static DbusmenuMenuitem *lock_menuitem = NULL;
-static DbusmenuMenuitem *system_settings_menuitem = NULL;
static DBusGProxyCall * suspend_call = NULL;
static DBusGProxyCall * hibernate_call = NULL;
@@ -414,22 +413,19 @@ show_system_settings (DbusmenuMenuitem * mi G_GNUC_UNUSED,
static void
device_menu_mgr_build_settings_items (DeviceMenuMgr* self)
{
- system_settings_menuitem = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set (system_settings_menuitem,
- DBUSMENU_MENUITEM_PROP_LABEL,
- _("System Settingsā€¦"));
- g_signal_connect (G_OBJECT(system_settings_menuitem),
- DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
+ DbusmenuMenuitem * mi;
+
+ /* system settings... */
+ mi = dbusmenu_menuitem_new ();
+ dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_LABEL, _("System Settingsā€¦"));
+ dbusmenu_menuitem_child_add_position(self->root_item, mi, 0);
+ g_signal_connect (G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
G_CALLBACK(show_system_settings), NULL);
- dbusmenu_menuitem_child_add_position(self->root_item,
- system_settings_menuitem,
- 0);
-
- DbusmenuMenuitem * separator1 = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set (separator1,
- DBUSMENU_MENUITEM_PROP_TYPE,
- DBUSMENU_CLIENT_TYPES_SEPARATOR);
- dbusmenu_menuitem_child_add_position (self->root_item, separator1, 1);
+
+ /* separator */
+ mi = dbusmenu_menuitem_new();
+ dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR);
+ dbusmenu_menuitem_child_add_position (self->root_item, mi, 1);
}
static void