diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c index 2478d7e..6d08ec3 100644 --- a/thunar/thunar-standard-view.c +++ b/thunar/thunar-standard-view.c @@ -1548,9 +1548,9 @@ thunar_standard_view_delete_selected_files (ThunarStandardView *standard_view) /* if this looks like a permanently delete */ permanently = (gtk_get_current_event_state (&state) && (state & GDK_SHIFT_MASK) != 0); - /* check if the user defined a custom accelerator and is not holding the - * shift button. if he or she has, we don't response to the predefined key - * bindings (bug #4173) */ + /* Check if the user defined a custom accelerator and is not holding the + * shift button. If he or she has, we won't respond to the predefined key + * bindings (bug #4173). */ accel_path = gtk_action_get_accel_path (action); if (accel_path != NULL && gtk_accel_map_lookup_entry (accel_path, &key) && key.accel_key != 0 && key.accel_mods != 0 && permanently == FALSE) @@ -2294,15 +2294,32 @@ static void thunar_standard_view_action_rename (GtkAction *action, ThunarStandardView *standard_view) { - ThunarFile *file; - GtkWidget *window; - ThunarJob *job; + ThunarFile *file; + GtkWidget *window; + ThunarJob *job; + const gchar *accel_path; + GtkAccelKey key; + GdkModifierType state; + gboolean force_bulk_renamer; _thunar_return_if_fail (GTK_IS_ACTION (action)); _thunar_return_if_fail (THUNAR_IS_STANDARD_VIEW (standard_view)); + /* if this looks like a permanently delete */ + force_bulk_renamer = (gtk_get_current_event_state (&state) && (state & GDK_SHIFT_MASK) != 0); + + /* Check if the user defined a custom accelerator and is not holding the + * shift button. If he or she has, we won't respond to the predefined key + * bindings (bug #4173). */ + accel_path = gtk_action_get_accel_path (action); + if (accel_path != NULL && gtk_accel_map_lookup_entry (accel_path, &key) + && key.accel_key != 0 && key.accel_mods != 0 && force_bulk_renamer == FALSE) + return FALSE; + /* start renaming if we have exactly one selected file */ - if (G_LIKELY (standard_view->selected_files != NULL && standard_view->selected_files->next == NULL)) + if (G_LIKELY (standard_view->selected_files != NULL + && standard_view->selected_files->next == NULL + && ! force_bulk_renamer)) { /* get the window */ window = gtk_widget_get_toplevel (GTK_WIDGET (standard_view)); @@ -2318,7 +2335,8 @@ thunar_standard_view_action_rename (GtkAction *action, g_signal_connect (job, "finished", G_CALLBACK (thunar_standard_view_rename_finished), standard_view); } } - else if (g_list_length (standard_view->selected_files) > 1) + else if (G_LIKELY (force_bulk_renamer && standard_view->selected_files != NULL) + || g_list_length (standard_view->selected_files) > 1) { /* determine the current directory of the view */ file = thunar_navigator_get_current_directory (THUNAR_NAVIGATOR (standard_view));