summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2020-02-21 21:10:44 -0500
committerPablo Barciela <[email protected]>2020-03-04 11:04:16 +0100
commit442c061e77cc9d933f73f19f286764cdad68dd8f (patch)
treee457fefdd892105865016b22e932152765ac0213
parenta0bd49b3c97a36e6c6f89931ec975a7dfb635afb (diff)
downloadcaja-442c061e77cc9d933f73f19f286764cdad68dd8f.tar.bz2
caja-442c061e77cc9d933f73f19f286764cdad68dd8f.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.c30
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);