From 442c061e77cc9d933f73f19f286764cdad68dd8f Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Fri, 21 Feb 2020 21:10:44 -0500 Subject: Confirm before deleting during an undo operation Unless user turns 'Ask before emptying trash or deleting files" off. Remove special case direct delete code that broke this behavior Also remove now unused priv->confirm_delete As we no longer use unique code directly deleting files that used it --- libcaja-private/caja-undostack-manager.c | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) (limited to 'libcaja-private/caja-undostack-manager.c') diff --git a/libcaja-private/caja-undostack-manager.c b/libcaja-private/caja-undostack-manager.c index c80b4f79..ddc22b34 100644 --- a/libcaja-private/caja-undostack-manager.c +++ b/libcaja-private/caja-undostack-manager.c @@ -265,7 +265,6 @@ caja_undostack_manager_init (CajaUndoStackManager * self) priv->index = 0; priv->dispose_has_run = FALSE; priv->undo_redo_flag = FALSE; - priv->confirm_delete = FALSE; } static void @@ -320,9 +319,6 @@ caja_undostack_manager_set_property (GObject * object, guint prop_id, do_menu_update (manager); } break; - case PROP_CONFIRM_DELETE: - priv->confirm_delete = g_value_get_boolean (value); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -423,7 +419,7 @@ caja_undostack_manager_redo (CajaUndoStackManager * manager, uris = construct_gfile_list (action->sources, action->src_dir); caja_file_operations_copy (uris, NULL, action->dest_dir, NULL, undo_redo_done_transfer_callback, action); - g_list_free_full (uris, g_object_unref); + g_list_free_full (uris, g_object_unref); break; } case CAJA_UNDOSTACK_CREATEFILEFROMTEMPLATE: @@ -614,25 +610,11 @@ caja_undostack_manager_undo (CajaUndoStackManager * manager, uris = construct_gfile_list (action->destinations, action->dest_dir); uris = g_list_reverse (uris); // Deleting must be done in reverse } - if (priv->confirm_delete) { - caja_file_operations_delete (uris, NULL, - undo_redo_done_delete_callback, action); - g_list_free_full (uris, g_object_unref); - } else { - /* We skip the confirmation message - */ - GList *f; - for (f = uris; f != NULL; f = f->next) { - char *name; - name = g_file_get_uri (f->data); - g_free (name); - g_file_delete (f->data, NULL, NULL); - g_object_unref (f->data); - } - g_list_free (uris); - /* Here we must do what's necessary for the callback */ - undo_redo_done_transfer_callback (NULL, action); - } + + caja_file_operations_delete (uris, NULL, + undo_redo_done_delete_callback, action); + g_list_free_full (uris, g_object_unref); + break; case CAJA_UNDOSTACK_RESTOREFROMTRASH: uris = construct_gfile_list (action->destinations, action->dest_dir); -- cgit v1.2.1