[Xfce4-commits] [xfce/thunar] 02/02: Clear user customizable action shortcut when the action is deleted
noreply at xfce.org
noreply at xfce.org
Wed Sep 18 03:25:22 CEST 2019
This is an automated email from the git hooks/post-receive script.
a n d r e p u s h e d a c o m m i t t o b r a n c h x f c e - 4 . 1 4
in repository xfce/thunar.
commit ebb3936eb2d7375a26f9d1e863975e153d72c9a4
Author: Reuben Green <reubengreen73 at gmail.com>
Date: Tue Sep 17 15:28:40 2019 +0100
Clear user customizable action shortcut when the action is deleted
Bug #15970
Fixes a bug which causes a keyboard shortcut to become permenantly unavailable
for use in a user customizable action (uca) if it has been used in a previously
deleted uca, by adding code to clear any keyboard shortcut associated to a uca
when it is deleted.
---
plugins/thunar-uca/thunar-uca-model.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/plugins/thunar-uca/thunar-uca-model.c b/plugins/thunar-uca/thunar-uca-model.c
index 91f6e4a..54f0dd1 100644
--- a/plugins/thunar-uca/thunar-uca-model.c
+++ b/plugins/thunar-uca/thunar-uca-model.c
@@ -1263,10 +1263,24 @@ thunar_uca_model_remove (ThunarUcaModel *uca_model,
{
ThunarUcaModelItem *item;
GtkTreePath *path;
+ gchar *unique_id;
+ gchar *accel_path;
+ GtkAccelKey key;
g_return_if_fail (THUNAR_UCA_IS_MODEL (uca_model));
g_return_if_fail (iter->stamp == uca_model->stamp);
+ /* clear any accelerator associated to the item */
+ gtk_tree_model_get (GTK_TREE_MODEL (uca_model), iter,
+ THUNAR_UCA_MODEL_COLUMN_UNIQUE_ID, &unique_id,
+ -1);
+ accel_path = g_strdup_printf ("<Actions>/ThunarActions/uca-action-%s", unique_id);
+
+ if (gtk_accel_map_lookup_entry (accel_path, &key) && key.accel_key != 0)
+ gtk_accel_map_change_entry (accel_path, 0, 0, TRUE);
+
+ g_free (accel_path);
+
/* determine the path for the item to remove */
path = gtk_tree_model_get_path (GTK_TREE_MODEL (uca_model), iter);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list