[Xfce4-commits] <xfce4-settings:stephan/dialogs> Clear out all the old entries before resetting to defaults

Nick Schermer noreply at xfce.org
Tue Mar 27 19:46:24 CEST 2012


Updating branch refs/heads/stephan/dialogs
         to 6d5cf80f7b7826e791d503713c965e969549ea15 (commit)
       from 5173ad38b11edf3f58831ce421a22358ba147f02 (commit)

commit 6d5cf80f7b7826e791d503713c965e969549ea15
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Sun Feb 12 14:41:41 2012 +0300

    Clear out all the old entries before resetting to defaults
    
    When resetting the keyboard shortcuts to their default entries we
    need to clear out all the old entires in the list to prevent
    duplicates from appearing. (Bug 8138)

 dialogs/keyboard-settings/xfce-keyboard-settings.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/dialogs/keyboard-settings/xfce-keyboard-settings.c b/dialogs/keyboard-settings/xfce-keyboard-settings.c
index 8776a69..e8b6811 100644
--- a/dialogs/keyboard-settings/xfce-keyboard-settings.c
+++ b/dialogs/keyboard-settings/xfce-keyboard-settings.c
@@ -958,7 +958,9 @@ xfce_keyboard_settings_delete_button_clicked (XfceKeyboardSettings *settings)
 static void
 xfce_keyboard_settings_reset_button_clicked (XfceKeyboardSettings *settings)
 {
-  gint response;
+  gint          response;
+  GObject      *view;
+  GtkListStore *store;
 
   g_return_if_fail (XFCE_IS_KEYBOARD_SETTINGS (settings));
 
@@ -971,7 +973,15 @@ xfce_keyboard_settings_reset_button_clicked (XfceKeyboardSettings *settings)
                                   NULL);
 
   if (G_LIKELY (response == GTK_RESPONSE_YES))
-    xfce_shortcuts_provider_reset_to_defaults (settings->priv->provider);
+    {
+      view = gtk_builder_get_object (GTK_BUILDER (settings), "kbd_shortcuts_view");
+
+      /* Clear out all the previous entries */
+      store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (view)));
+      gtk_list_store_clear (store);
+
+      xfce_shortcuts_provider_reset_to_defaults (settings->priv->provider);
+    }
 }
 
 


More information about the Xfce4-commits mailing list