From 4b082aa8275f777744730ffbd0d72ede5733d57a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Oct 03 2009 02:23:53 +0000 Subject: fix logic errors in the keybinding capplet --- diff --git a/control-center.spec b/control-center.spec index b2ccc6f..4564576 100644 --- a/control-center.spec +++ b/control-center.spec @@ -24,7 +24,7 @@ Summary: Utilities to configure the GNOME desktop Name: control-center Version: 2.28.0 -Release: 13%{?dist} +Release: 14%{?dist} Epoch: 1 License: GPLv2+ and GFDL Group: User Interface/Desktops @@ -64,6 +64,9 @@ Patch51: mirror-crash.patch # https://bugzilla.gnome.org/show_bug.cgi?id=597066 Patch52: shell-markup.patch +# https://bugzilla.gnome.org/show_bug.cgi?id=596939 +Patch53: keybinding-bugs.patch + # call the Fedora/RHEL graphical passwd changing apps Patch95: gnome-control-center-2.25.2-passwd.patch Patch96: gnome-control-center-2.25.2-gecos.patch @@ -200,6 +203,7 @@ for the GNOME desktop. %patch50 -p1 -b .fix-background-tooltips %patch51 -p1 -b .mirror-crash %patch52 -p1 -b .shell-markup +%patch53 -p1 -b .keybinding-bugs # vendor configuration patches %patch95 -p1 -b .passwd @@ -390,6 +394,10 @@ fi %changelog +* Fri Oct 2 2009 Matthias Clasen 2.28.0-14 +- Fix some logic errors in the keybinding capplet that can lead + to missing entries + * Fri Oct 2 2009 Matthias Clasen 2.28.0-13 - Don't show markup in the UI diff --git a/keybinding-bugs.patch b/keybinding-bugs.patch new file mode 100644 index 0000000..11750a9 --- /dev/null +++ b/keybinding-bugs.patch @@ -0,0 +1,79 @@ +From e0c60bbd3064a67b975d92adc417878ea8949c95 Mon Sep 17 00:00:00 2001 +From: Robert Ancell +Date: Thu, 1 Oct 2009 12:45:25 +1000 +Subject: [PATCH] Fix broken logic in keybinding tree model + +--- + capplets/keybindings/gnome-keybinding-properties.c | 24 ++++++++----------- + 1 files changed, 10 insertions(+), 14 deletions(-) + +diff --git a/capplets/keybindings/gnome-keybinding-properties.c b/capplets/keybindings/gnome-keybinding-properties.c +index 6e36e34..0b62f8c 100644 +--- a/capplets/keybindings/gnome-keybinding-properties.c ++++ b/capplets/keybindings/gnome-keybinding-properties.c +@@ -522,11 +522,10 @@ find_section (GtkTreeModel *model, + GtkTreeIter *iter, + const char *title) + { +- gboolean success, found; ++ gboolean success; + +- found = FALSE; + success = gtk_tree_model_get_iter_first (model, iter); +- while (success && !found) ++ while (success) + { + char *description = NULL; + +@@ -534,16 +533,15 @@ find_section (GtkTreeModel *model, + DESCRIPTION_COLUMN, &description, + -1); + +- found = (g_strcmp0 (description, title) == 0); ++ if (g_strcmp0 (description, title) == 0) ++ return; + success = gtk_tree_model_iter_next (model, iter); + } +- if (!found) +- { +- gtk_tree_store_append (GTK_TREE_STORE (model), iter, NULL); +- gtk_tree_store_set (GTK_TREE_STORE (model), iter, +- DESCRIPTION_COLUMN, title, +- -1); +- } ++ ++ gtk_tree_store_append (GTK_TREE_STORE (model), iter, NULL); ++ gtk_tree_store_set (GTK_TREE_STORE (model), iter, ++ DESCRIPTION_COLUMN, title, ++ -1); + } + + static void +@@ -555,7 +553,6 @@ append_keys_to_tree (GtkBuilder *builder, + GtkTreeIter parent_iter, iter; + GtkTreeModel *model; + gint i, j; +- gint rows_before; + + client = gconf_client_get_default (); + model = gtk_tree_view_get_model (GTK_TREE_VIEW (gtk_builder_get_object (builder, "shortcut_treeview"))); +@@ -571,7 +568,6 @@ append_keys_to_tree (GtkBuilder *builder, + * then we need to scroll now */ + ensure_scrollbar (builder, i - 1); + +- rows_before = i; + for (j = 0; keys_list[j].name != NULL; j++) + { + GConfEntry *entry; +@@ -689,7 +685,7 @@ append_keys_to_tree (GtkBuilder *builder, + g_object_unref (client); + + /* Don't show an empty section */ +- if (i == rows_before) ++ if (gtk_tree_model_iter_n_children (model, &parent_iter) == 0) + gtk_tree_store_remove (GTK_TREE_STORE (model), &parent_iter); + + if (i == 0) +-- +1.6.3.3 +