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
This commit is contained in:
Rui Matos 2012-08-13 22:02:36 +02:00 committed by Bastien Nocera
parent 923f27950a
commit 7bce5758c8

View file

@ -247,8 +247,6 @@ append_section (GtkBuilder *builder,
/* Add the keys to the hash table */ /* Add the keys to the hash table */
if (is_new) if (is_new)
{ {
static gboolean have_sep = FALSE;
g_hash_table_insert (hash, g_strdup (title), keys_array); g_hash_table_insert (hash, g_strdup (title), keys_array);
/* Append the section to the left tree view */ /* Append the section to the left tree view */
@ -257,16 +255,6 @@ append_section (GtkBuilder *builder,
SECTION_DESCRIPTION_COLUMN, title, SECTION_DESCRIPTION_COLUMN, title,
SECTION_GROUP_COLUMN, group, SECTION_GROUP_COLUMN, group,
-1); -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_hash_table_destroy (loaded_files);
g_strfreev (wm_keybindings); 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 */ /* Load custom keybindings */
append_sections_from_gsettings (builder); append_sections_from_gsettings (builder);