diff options
author | lukefromdc <[email protected]> | 2020-02-21 21:10:44 -0500 |
---|---|---|
committer | lukefromdc <[email protected]> | 2020-03-03 21:22:36 +0000 |
commit | 4e07c3562c4c094e9b943c75524a94150859c9b4 (patch) | |
tree | a0dea157313e4f97c339ef808d1eaa7e53a16a1e | |
parent | 0d805cabb549879d8722015a57f65ab75ab0fdf6 (diff) | |
download | caja-4e07c3562c4c094e9b943c75524a94150859c9b4.tar.bz2 caja-4e07c3562c4c094e9b943c75524a94150859c9b4.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
-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); |