aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-06-05 14:03:37 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-06-05 14:03:37 -0500
commit47c518ad38b92b2341f85893cc0eca25c3a2bf3c (patch)
tree0306a8113afe75945919340c4cbf453ea5aa5916
parent913dcda481011189ce4dfd338e11e86ee48a49e1 (diff)
downloadayatana-indicator-session-47c518ad38b92b2341f85893cc0eca25c3a2bf3c.tar.gz
ayatana-indicator-session-47c518ad38b92b2341f85893cc0eca25c3a2bf3c.tar.bz2
ayatana-indicator-session-47c518ad38b92b2341f85893cc0eca25c3a2bf3c.zip
In device-menu-mgr.c, lockdown_changed() only exists as a pass-thru for having LOCKDOWN_KEY_USER and LOCKDOWN_KEY_SCREENSAVER changes force a menu rebuild, so eliminate the middleman and connect those property changes directly to the menu rebuild
-rw-r--r--src/device-menu-mgr.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c
index 1e62262..5b212e7 100644
--- a/src/device-menu-mgr.c
+++ b/src/device-menu-mgr.c
@@ -107,27 +107,6 @@ device_menu_mgr_class_init (DeviceMenuMgrClass *klass)
object_class->finalize = device_menu_mgr_finalize;
}
-// TODO
-// Is this needed anymore
-static void
-lockdown_changed (GSettings * settings,
- const gchar * key,
- gpointer user_data)
-{
- DeviceMenuMgr* self = DEVICE_MENU_MGR (user_data);
-
- if (key == NULL) {
- return;
- }
-
- if (g_strcmp0 (key, LOCKDOWN_KEY_USER) == 0 ||
- g_strcmp0 (key, LOCKDOWN_KEY_SCREENSAVER) == 0) {
- device_menu_mgr_rebuild_items(self);
- }
-
- return;
-}
-
static void
update_screensaver_shortcut (DbusmenuMenuitem * menuitem, GSettings * settings)
{
@@ -578,7 +557,8 @@ device_menu_mgr_ensure_settings_client (DeviceMenuMgr* self)
{
if (!lockdown_settings) {
lockdown_settings = g_settings_new (LOCKDOWN_SCHEMA);
- g_signal_connect(lockdown_settings, "changed", G_CALLBACK(lockdown_changed), self);
+ g_signal_connect_swapped (lockdown_settings, "changed::" LOCKDOWN_KEY_USER, G_CALLBACK(device_menu_mgr_rebuild_items), self);
+ g_signal_connect_swapped (lockdown_settings, "changed::" LOCKDOWN_KEY_SCREENSAVER, G_CALLBACK(device_menu_mgr_rebuild_items), self);
}
if (!keybinding_settings) {
keybinding_settings = g_settings_new (KEYBINDING_SCHEMA);