[gnome-settings-daemon] a11y-keyboard: Simplify ax_response_callback() further



commit 6fe7df14db6bfecd79ea37ef09f022e184ddd057
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jan 16 12:00:51 2013 +0100

    a11y-keyboard: Simplify ax_response_callback() further

 plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)
---
diff --git a/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c b/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c
index 46b6a88..d9d6c47 100644
--- a/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c
+++ b/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c
@@ -332,31 +332,22 @@ ax_response_callback (GsdA11yKeyboardManager *manager,
                       guint                   revert_controls_mask,
                       gboolean                enabled)
 {
-        GSettings *settings;
-
-        settings = manager->priv->settings;
-
-        switch (response_id) {
-        case GTK_RESPONSE_REJECT:
-
+        if (response_id == GTK_RESPONSE_REJECT) {
                 /* we're reverting, so we invert sense of 'enabled' flag */
                 g_debug ("cancelling AccessX request");
                 if (revert_controls_mask == XkbStickyKeysMask) {
-                        g_settings_set_boolean (settings,
+                        g_settings_set_boolean (manager->priv->settings,
                                                 "stickykeys-enable",
                                                 !enabled);
                 } else if (revert_controls_mask == XkbSlowKeysMask) {
-                        g_settings_set_boolean (settings,
+                        g_settings_set_boolean (manager->priv->settings,
                                                 "slowkeys-enable",
                                                 !enabled);
                 }
 
                 set_server_from_gsettings (manager);
-                break;
-
-        default:
-                break;
         }
+
         return TRUE;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]