diff options
author | lukefromdc <[email protected]> | 2020-02-21 21:10:44 -0500 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-07-20 23:37:04 +0200 |
commit | 73bd964976481cd597b7d1fda6d455179f184187 (patch) | |
tree | 76e98440352fb02624f22fd874cb85b855bdd216 /libcaja-private/caja-undostack-manager.c | |
parent | b15a113970e6ee2b3ac74778968332f1b18b62f5 (diff) | |
download | caja-73bd964976481cd597b7d1fda6d455179f184187.tar.bz2 caja-73bd964976481cd597b7d1fda6d455179f184187.tar.xz |
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
Diffstat (limited to 'libcaja-private/caja-undostack-manager.c')
-rw-r--r-- | libcaja-private/caja-undostack-manager.c | 30 |
1 files changed, 6 insertions, 24 deletions
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); |