[gnome-control-center] keyboard: Allocate required space for replacing a key shortcut
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] keyboard: Allocate required space for replacing a key shortcut
- Date: Mon, 20 Feb 2012 10:21:07 +0000 (UTC)
commit 30c073ffee724526b563d0d7925dc5b668c432a3
Author: Tomas Bzatek <tbzatek redhat com>
Date: Thu Feb 16 18:33:01 2012 +0100
keyboard: Allocate required space for replacing a key shortcut
https://bugzilla.gnome.org/show_bug.cgi?id=670236
panels/keyboard/cc-keyboard-item.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/panels/keyboard/cc-keyboard-item.c b/panels/keyboard/cc-keyboard-item.c
index 82fab15..56eb4af 100644
--- a/panels/keyboard/cc-keyboard-item.c
+++ b/panels/keyboard/cc-keyboard-item.c
@@ -119,6 +119,13 @@ settings_set_binding (GSettings *settings,
str_array = g_variant_dup_strv (variant, NULL);
+ /* create a space for the new binding if empty */
+ if (*str_array == NULL)
+ {
+ g_free (str_array);
+ str_array = g_new0 (char *, 2);
+ }
+
/* replace the first binding */
g_free (*str_array);
*str_array = g_strdup (value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]