diff options
author | Sachin Daluja <30343-sachindaluja@users.noreply.gitlab.gnome.org> | 2021-01-24 11:54:59 -0500 |
---|---|---|
committer | Sachin Daluja <30343-sachindaluja@users.noreply.gitlab.gnome.org> | 2021-02-06 10:43:51 -0500 |
commit | e96aac1f6526f5373405e071703b5f18b0c728d3 (patch) | |
tree | aab2c135168c204226123334ee68a07f004e44c8 /src/nautilus-file-operations.c | |
parent | d2e3decfa35a327a650630910617ad8442587ea7 (diff) | |
download | nautilus-e96aac1f6526f5373405e071703b5f18b0c728d3.tar.gz |
general: Remove option to bypass delete confirmation
A gsettings-based option "confirm-trash" existed to determine if a
confirmation dialog should be shown when emptying the trash. This
setting, enabled by default, was misappropriated for the unrelated
"delete directly" operation of files outside Trash. This latter use of
this setting was misleading and unexpected (more discussion on the
linked issue page.)
Remove option "confirm-trash" entirely because neither of the above
mentioned operations are reversible, so they should always require
confirmation.
Add ellipsis to labels for the "empty trash" and "delete permanently"
actions since they now always invoke a confirmation dialog.
Closes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1699
Diffstat (limited to 'src/nautilus-file-operations.c')
-rw-r--r-- | src/nautilus-file-operations.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c index 85c42f12f..bb1d04acc 100644 --- a/src/nautilus-file-operations.c +++ b/src/nautilus-file-operations.c @@ -54,7 +54,6 @@ #include "nautilus-operations-ui-manager.h" #include "nautilus-file-changes-queue.h" #include "nautilus-file-private.h" -#include "nautilus-global-preferences.h" #include "nautilus-trash-monitor.h" #include "nautilus-file-utilities.h" #include "nautilus-file-undo-operations.h" @@ -1639,19 +1638,6 @@ job_aborted (CommonJob *job) return g_cancellable_is_cancelled (job->cancellable); } -/* Since this happens on a thread we can't use the global prefs object */ -static gboolean -should_confirm_trash (void) -{ - GSettings *prefs; - gboolean confirm_trash; - - prefs = g_settings_new ("org.gnome.nautilus.preferences"); - confirm_trash = g_settings_get_boolean (prefs, NAUTILUS_PREFERENCES_CONFIRM_TRASH); - g_object_unref (prefs); - return confirm_trash; -} - static gboolean confirm_delete_from_trash (CommonJob *job, GList *files) @@ -1660,12 +1646,6 @@ confirm_delete_from_trash (CommonJob *job, int file_count; int response; - /* Just Say Yes if the preference says not to confirm. */ - if (!should_confirm_trash ()) - { - return TRUE; - } - file_count = g_list_length (files); g_assert (file_count > 0); @@ -1704,12 +1684,6 @@ confirm_empty_trash (CommonJob *job) char *prompt; int response; - /* Just Say Yes if the preference says not to confirm. */ - if (!should_confirm_trash ()) - { - return TRUE; - } - prompt = g_strdup (_("Empty all items from Trash?")); response = run_warning (job, @@ -1731,12 +1705,6 @@ confirm_delete_directly (CommonJob *job, int file_count; int response; - /* Just Say Yes if the preference says not to confirm. */ - if (!should_confirm_trash ()) - { - return TRUE; - } - file_count = g_list_length (files); g_assert (file_count > 0); |