summaryrefslogtreecommitdiff
path: root/src/fr-window.c
diff options
context:
space:
mode:
authorjishengjie <[email protected]>2022-12-14 15:38:30 +0800
committermouse <[email protected]>2023-03-21 17:34:55 +0800
commitc279d858e62bb7d6dbca8e3686e22a5bf88c79f8 (patch)
tree63fc78a7c699373ab15d56ce32f2290707cd74e7 /src/fr-window.c
parentc16b9005558acb5d6cfa23259604c26f8919d8bd (diff)
downloadengrampa-c279d858e62bb7d6dbca8e3686e22a5bf88c79f8.tar.bz2
engrampa-c279d858e62bb7d6dbca8e3686e22a5bf88c79f8.tar.xz
fix: Encrypted documents in. 7z format cannot delete locked files and folders
Diffstat (limited to 'src/fr-window.c')
-rw-r--r--src/fr-window.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/fr-window.c b/src/fr-window.c
index 3c71431..8061a39 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -6317,14 +6317,34 @@ fr_window_archive_add_dropped_items (FrWindow *window,
window->priv->volume_size);
}
+static void
+remove_data_free (GList *rdata)
+{
+ g_list_free_full(rdata, g_free);
+}
+
void
fr_window_archive_remove (FrWindow *window,
GList *file_list)
{
+ char *password;
+ GList *remove_list;
+
fr_window_clipboard_remove_file_list (window, file_list);
fr_process_clear (window->archive->process);
- fr_archive_remove (window->archive, file_list, window->priv->compression);
+
+ remove_list = g_list_copy_deep (file_list, (GCopyFunc) g_strdup, NULL);
+ fr_window_set_current_batch_action (window,
+ FR_BATCH_ACTION_DELETE,
+ remove_list,
+ (GFreeFunc) remove_data_free);
+
+ password = window->priv->password;
+ if (password != NULL && password[0] != '\0')
+ g_object_set (window->archive->command, "password", password, NULL);
+
+ fr_archive_remove (window->archive, remove_list, window->priv->compression);
fr_process_start (window->archive->process);
}
@@ -8529,6 +8549,12 @@ fr_window_exec_batch_action (FrWindow *window,
fr_window_archive_add_dropped_items (window, (GList*) action->data, FALSE);
break;
+ case FR_BATCH_ACTION_DELETE:
+ debug (DEBUG_INFO, "[BATCH] DELETE\n");
+
+ fr_window_archive_remove (window, (GList*) action->data);
+ break;
+
case FR_BATCH_ACTION_OPEN:
debug (DEBUG_INFO, "[BATCH] OPEN\n");