[file-roller] Cannot delete files from password protected 7zip archives
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller] Cannot delete files from password protected 7zip archives
- Date: Sun, 15 Feb 2015 16:50:17 +0000 (UTC)
commit 0bb26ee4223cdcbca9aa0816c81069b74f15c2f7
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sun Feb 15 17:48:23 2015 +0100
Cannot delete files from password protected 7zip archives
[bug #618909]
src/fr-command-7z.c | 6 +-----
src/fr-command.c | 4 ++++
src/fr-window.c | 26 +++++++++++++++++++++++++-
src/fr-window.h | 1 +
4 files changed, 31 insertions(+), 6 deletions(-)
---
diff --git a/src/fr-command-7z.c b/src/fr-command-7z.c
index 809717f..e6e8258 100644
--- a/src/fr-command-7z.c
+++ b/src/fr-command-7z.c
@@ -424,11 +424,7 @@ fr_command_7z_delete (FrCommand *command,
if (g_str_has_prefix (scan->data, "@"))
fr_process_add_arg_concat (command->process, "-i!", scan->data, NULL);
- if (archive->encrypt_header
- && fr_archive_is_capable_of (archive, FR_ARCHIVE_CAN_ENCRYPT_HEADER))
- {
- add_password_arg (command, FR_ARCHIVE (command)->password, FALSE);
- }
+ add_password_arg (command, FR_ARCHIVE (command)->password, FALSE);
fr_process_add_arg (command->process, "--");
fr_process_add_arg (command->process, command->filename);
diff --git a/src/fr-command.c b/src/fr-command.c
index 69436de..f4d0af6 100644
--- a/src/fr-command.c
+++ b/src/fr-command.c
@@ -632,6 +632,10 @@ _fr_command_load_complete (XferData *xfer_data,
* original name */
if (archive->multi_volume)
fr_archive_change_name (archive, FR_COMMAND (archive)->filename);
+
+ /* the header is encrypted if the load is successful and the password is not void */
+ archive->encrypt_header = (xfer_data->password != NULL) && (*xfer_data->password != '\0');
+
fr_archive_update_capabilities (archive);
}
else
diff --git a/src/fr-window.c b/src/fr-window.c
index d23cf11..323268b 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -6213,6 +6213,9 @@ fr_window_archive_add_dropped_items (FrWindow *window,
}
+/* -- fr_window_archive_remove -- */
+
+
static void
archive_remove_ready_cb (GObject *source_object,
GAsyncResult *result,
@@ -6232,10 +6235,26 @@ void
fr_window_archive_remove (FrWindow *window,
GList *file_list)
{
+ GList *new_file_list;
+
+ new_file_list = _g_string_list_dup (file_list);
+ fr_window_set_current_batch_action (window,
+ FR_BATCH_ACTION_REMOVE,
+ new_file_list,
+ (GFreeFunc) _g_string_list_free);
+
_archive_operation_started (window, FR_ACTION_DELETING_FILES);
+
+ g_object_set (window->archive,
+ "compression", window->priv->compression,
+ "encrypt-header", window->priv->encrypt_header,
+ "password", window->priv->password,
+ "volume-size", window->priv->volume_size,
+ NULL);
+
fr_window_clipboard_remove_file_list (window, file_list);
fr_archive_remove (window->archive,
- file_list,
+ new_file_list,
window->priv->compression,
window->priv->cancellable,
archive_remove_ready_cb,
@@ -9175,6 +9194,11 @@ fr_window_exec_batch_action (FrWindow *window,
fr_window_archive_add_dropped_items (window, (GList *) action->data);
break;
+ case FR_BATCH_ACTION_REMOVE:
+ debug (DEBUG_INFO, "[BATCH] REMOVE\n");
+ fr_window_archive_remove (window, (GList *) action->data);
+ break;
+
case FR_BATCH_ACTION_OPEN:
debug (DEBUG_INFO, "[BATCH] OPEN\n");
diff --git a/src/fr-window.h b/src/fr-window.h
index 0aabaf6..13a48a4 100644
--- a/src/fr-window.h
+++ b/src/fr-window.h
@@ -54,6 +54,7 @@ typedef enum {
FR_BATCH_ACTION_LOAD,
FR_BATCH_ACTION_OPEN,
FR_BATCH_ACTION_ADD,
+ FR_BATCH_ACTION_REMOVE,
FR_BATCH_ACTION_EXTRACT,
FR_BATCH_ACTION_EXTRACT_HERE,
FR_BATCH_ACTION_EXTRACT_INTERACT,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]