[gnome-control-center] keyboard: Fix adding the section separator after the first time



commit 7bce5758c8facf21be012c815f60fdb720515e97
Author: Rui Matos <tiagomatos gmail com>
Date:   Mon Aug 13 22:02:36 2012 +0200

    keyboard: Fix adding the section separator after the first time
    
    The separator would only get added the first time the keyboard panel
    was opened.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=681788

 panels/keyboard/keyboard-shortcuts.c |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)
---
diff --git a/panels/keyboard/keyboard-shortcuts.c b/panels/keyboard/keyboard-shortcuts.c
index 8b1f471..bd24118 100644
--- a/panels/keyboard/keyboard-shortcuts.c
+++ b/panels/keyboard/keyboard-shortcuts.c
@@ -247,8 +247,6 @@ append_section (GtkBuilder         *builder,
   /* Add the keys to the hash table */
   if (is_new)
     {
-      static gboolean have_sep = FALSE;
-
       g_hash_table_insert (hash, g_strdup (title), keys_array);
 
       /* Append the section to the left tree view */
@@ -257,16 +255,6 @@ append_section (GtkBuilder         *builder,
                           SECTION_DESCRIPTION_COLUMN, title,
                           SECTION_GROUP_COLUMN, group,
                           -1);
-      if (!have_sep && group != BINDING_GROUP_SYSTEM)
-        {
-          have_sep = TRUE;
-          /* Append the section to the left tree view */
-          gtk_list_store_append (GTK_LIST_STORE (model), &iter);
-          gtk_list_store_set (GTK_LIST_STORE (model), &iter,
-                              SECTION_DESCRIPTION_COLUMN, NULL,
-                              SECTION_GROUP_COLUMN, BINDING_GROUP_SYSTEM,
-                              -1);
-        }
     }
 }
 
@@ -655,6 +643,13 @@ reload_sections (GtkBuilder *builder)
   g_hash_table_destroy (loaded_files);
   g_strfreev (wm_keybindings);
 
+  /* Add a separator */
+  gtk_list_store_append (GTK_LIST_STORE (section_model), &iter);
+  gtk_list_store_set (GTK_LIST_STORE (section_model), &iter,
+                      SECTION_DESCRIPTION_COLUMN, NULL,
+                      SECTION_GROUP_COLUMN, BINDING_GROUP_SYSTEM,
+                      -1);
+
   /* Load custom keybindings */
   append_sections_from_gsettings (builder);
 



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