[gnome-settings-daemon] media-keys: Update for egg key parsing change



commit 516293a3f76fa4e076b4b9358f221bcb2784767d
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jun 2 14:32:06 2011 +0100

    media-keys: Update for egg key parsing change

 plugins/media-keys/gsd-media-keys-manager.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index eb5418a..63e3849 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -331,7 +331,7 @@ update_kbd_cb (GSettings           *settings,
                         }
 
                         key = g_new0 (Key, 1);
-                        if (!egg_accelerator_parse_virtual (tmp, &key->keysym, &key->keycodes, &key->state)) {
+                        if (egg_accelerator_parse_virtual (tmp, &key->keysym, &key->keycodes, &key->state) != EGG_PARSE_ERROR_NONE) {
                                 g_free (tmp);
                                 g_free (key);
                                 break;
@@ -366,6 +366,7 @@ init_kbd (GsdMediaKeysManager *manager)
         for (i = 0; i < HANDLED_KEYS; i++) {
                 char *tmp;
                 Key  *key;
+                EggParseError ret;
 
                 if (keys[i].settings_key != NULL) {
                         tmp = g_settings_get_string (manager->priv->settings, keys[i].settings_key);
@@ -374,14 +375,19 @@ init_kbd (GsdMediaKeysManager *manager)
                 }
 
                 if (!is_valid_shortcut (tmp)) {
-                        g_debug ("Not a valid shortcut: '%s'", tmp);
+                        if (*tmp != '\0')
+                                g_debug ("Not a valid shortcut: '%s'", tmp);
                         g_free (tmp);
                         continue;
                 }
 
                 key = g_new0 (Key, 1);
-                if (!egg_accelerator_parse_virtual (tmp, &key->keysym, &key->keycodes, &key->state)) {
-                        g_debug ("Unable to parse: '%s'", tmp);
+                ret = egg_accelerator_parse_virtual (tmp, &key->keysym, &key->keycodes, &key->state);
+                if (ret != EGG_PARSE_ERROR_NONE) {
+                        if (keys[i].settings_key != NULL)
+                                g_debug ("Unable to parse key '%s' for GSettings entry '%s' (%d)", tmp, keys[i].settings_key, ret);
+                        else
+                                g_debug ("Unable to parse hard-coded key '%s' (%d)", keys[i].hard_coded, ret);
                         g_free (tmp);
                         g_free (key);
                         continue;



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