[gnome-control-center] keyboard: Always add the "Custom shortcuts" section



commit 53f78eec0b1472996cc2fbef4eb19afaf313a184
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Apr 26 15:20:45 2011 +0100

    keyboard: Always add the "Custom shortcuts" section
    
    Even if it is empty by default.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=648091

 panels/keyboard/keyboard-shortcuts.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/panels/keyboard/keyboard-shortcuts.c b/panels/keyboard/keyboard-shortcuts.c
index 2982007..ba90911 100644
--- a/panels/keyboard/keyboard-shortcuts.c
+++ b/panels/keyboard/keyboard-shortcuts.c
@@ -253,7 +253,7 @@ append_section (GtkBuilder         *builder,
       is_new = TRUE;
     }
 
-  for (i = 0; keys_list[i].name != NULL; i++)
+  for (i = 0; keys_list != NULL && keys_list[i].name != NULL; i++)
     {
       CcKeyboardItem *item;
       gboolean ret;
@@ -300,7 +300,7 @@ append_section (GtkBuilder         *builder,
     }
 
   /* Add the keys to the hash table */
-  if (is_new && keys_array->len > 0)
+  if (is_new)
     {
       static gboolean have_sep = FALSE;
 
@@ -649,6 +649,10 @@ append_sections_from_gconf (GtkBuilder *builder, const gchar *gconf_path)
           g_free (keys[i].name);
         }
     }
+  else
+    {
+      append_section (builder, _("Custom Shortcuts"), BINDING_GROUP_USER, NULL);
+    }
 
   g_array_free (entries, TRUE);
 }



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