From a7407923a327eefdf30ad6738f1b3761db0c2923 Mon Sep 17 00:00:00 2001 From: Theo Linkspfeifer Date: Tue, 10 Mar 2020 15:44:32 +0100 Subject: [PATCH] keyboard: Fix crash when editing shortcut (Bug #15958) --- .../keyboard-settings/xfce-keyboard-settings.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/dialogs/keyboard-settings/xfce-keyboard-settings.c b/dialogs/keyboard-settings/xfce-keyboard-settings.c index 3b2f4307..76169ada 100644 --- a/dialogs/keyboard-settings/xfce-keyboard-settings.c +++ b/dialogs/keyboard-settings/xfce-keyboard-settings.c @@ -1159,14 +1159,16 @@ xfce_keyboard_settings_edit_button_clicked (XfceKeyboardSettings *settings) test_new_shortcut = (g_strcmp0 (shortcut, new_shortcut) != 0); if (g_strcmp0 (command, new_command) != 0 || (test_new_shortcut) || snotify != new_snotify) { - /* Remove the row because we add new one from the - * shortcut-added signal */ - gtk_list_store_remove (GTK_LIST_STORE (model), &iter); - if (test_new_shortcut) - /* Remove old keyboard shortcut via xfconf */ - xfce_shortcuts_provider_reset_shortcut (settings->priv->provider, - shortcut); + { + /* Remove the row because we add new one from the + * shortcut-added signal */ + gtk_list_store_remove (GTK_LIST_STORE (model), &iter); + + /* Remove old keyboard shortcut via xfconf */ + xfce_shortcuts_provider_reset_shortcut (settings->priv->provider, + shortcut); + } /* Save settings */ xfce_shortcuts_provider_set_shortcut (settings->priv->provider, -- 2.25.0