Commit ebb3936e authored by Reuben Green's avatar Reuben Green Committed by Andre Miranda

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.
parent c1292ad5
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment