From b2d0b0ce18c909a535aca598f341a22ecfd6e0b2 Mon Sep 17 00:00:00 2001 From: Theo Linkspfeifer Date: Thu, 9 May 2019 23:57:01 +0200 Subject: [PATCH 1/1] Deactivate "Move to Trash" menu entry on volumes without trash (Bug #15352) --- thunar/thunar-standard-view.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c index af514ddd..d207a213 100644 --- a/thunar/thunar-standard-view.c +++ b/thunar/thunar-standard-view.c @@ -4443,6 +4443,7 @@ thunar_standard_view_selection_changed (ThunarStandardView *standard_view) gboolean pastable; gboolean writable; gboolean trashed; + gboolean trashable; gboolean show_delete_action; GList *lp, *selected_files; gint n_selected_files = 0; @@ -4482,10 +4483,11 @@ thunar_standard_view_selection_changed (ThunarStandardView *standard_view) /* and setup the new selected files list */ standard_view->priv->selected_files = selected_files; - /* check whether the folder displayed by the view is writable/in the trash */ + /* check whether the folder displayed by the view is writable/in the trash/can be trashed */ current_directory = thunar_navigator_get_current_directory (THUNAR_NAVIGATOR (standard_view)); writable = (current_directory != NULL && thunar_file_is_writable (current_directory)); trashed = (current_directory != NULL && thunar_file_is_trashed (current_directory)); + trashable = (current_directory != NULL && thunar_file_can_be_trashed (current_directory)); g_object_get (G_OBJECT (standard_view->preferences), "misc-show-delete-action", &show_delete_action, NULL); @@ -4531,7 +4533,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS /* update the "Move to Trash" action */ g_object_set (G_OBJECT (standard_view->priv->action_move_to_trash), - "sensitive", (n_selected_files > 0) && writable, + "sensitive", (n_selected_files > 0) && writable && trashable, "visible", !trashed && thunar_g_vfs_is_uri_scheme_supported ("trash"), "tooltip", ngettext ("Move the selected file to the Trash", "Move the selected files to the Trash", -- 2.20.1