import nautilus-40.2-6.el9
This commit is contained in:
parent
2f8f1dcd64
commit
8d7bd50df2
@ -177,7 +177,7 @@ index 52b1d9f2a..d1aa5131b 100644
|
||||
+
|
||||
+#: src/resources/ui/nautilus-compress-dialog.ui:36
|
||||
+msgid "Password protected .zip, must be installed on Windows and Mac."
|
||||
+msgstr "پروندهٔ .zip محافظتشده با گذرواژه. باید روی ویندوز و مک نصب باشد."
|
||||
+msgstr "پروندهٔ .zip محافظتشده با گذرواژه، باید روی ویندوز و مک نصب باشد."
|
||||
+
|
||||
+#: src/resources/ui/nautilus-compress-dialog.ui:213
|
||||
+msgid "Password"
|
||||
|
@ -0,0 +1,173 @@
|
||||
From f3b1a749669c241ae3802e72a22a4eb7d1a44eed Mon Sep 17 00:00:00 2001
|
||||
From: Clyde Laforge <clyde.laforge@protonmail.ch>
|
||||
Date: Mon, 16 Aug 2021 14:41:39 +0200
|
||||
Subject: [PATCH] compress-dialog: Set keyboard focus on the row with the
|
||||
selected archive format
|
||||
|
||||
Currently the keyboard focus for the type of archive choice is always on
|
||||
the first element.
|
||||
|
||||
This patch allows the focus to be on the currently selected item instead.
|
||||
|
||||
Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1944
|
||||
---
|
||||
src/nautilus-compress-dialog-controller.c | 62 ++++++++++++++++++++
|
||||
src/resources/ui/nautilus-compress-dialog.ui | 7 ++-
|
||||
2 files changed, 66 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/nautilus-compress-dialog-controller.c b/src/nautilus-compress-dialog-controller.c
|
||||
index e1ba5a803..3f7711ccb 100644
|
||||
--- a/src/nautilus-compress-dialog-controller.c
|
||||
+++ b/src/nautilus-compress-dialog-controller.c
|
||||
@@ -36,9 +36,13 @@ struct _NautilusCompressDialogController
|
||||
GtkWidget *error_label;
|
||||
GtkWidget *name_entry;
|
||||
GtkWidget *extension_stack;
|
||||
+ GtkWidget *zip_row;
|
||||
GtkWidget *zip_label;
|
||||
+ GtkWidget *encrypted_zip_row;
|
||||
GtkWidget *encrypted_zip_label;
|
||||
+ GtkWidget *tar_xz_row;
|
||||
GtkWidget *tar_xz_label;
|
||||
+ GtkWidget *seven_zip_row;
|
||||
GtkWidget *seven_zip_label;
|
||||
GtkWidget *extension_popover;
|
||||
GtkWidget *zip_checkmark;
|
||||
@@ -348,6 +352,50 @@ activate_button_on_sensitive_notify (GObject *gobject,
|
||||
}
|
||||
}
|
||||
|
||||
+static void
|
||||
+popover_on_show (GtkWidget *widget,
|
||||
+ gpointer user_data)
|
||||
+{
|
||||
+ NautilusCompressDialogController *self;
|
||||
+ NautilusCompressionFormat format;
|
||||
+
|
||||
+ self = NAUTILUS_COMPRESS_DIALOG_CONTROLLER (user_data);
|
||||
+ format = g_settings_get_enum (nautilus_compression_preferences,
|
||||
+ NAUTILUS_PREFERENCES_DEFAULT_COMPRESSION_FORMAT);
|
||||
+ switch (format)
|
||||
+ {
|
||||
+ case NAUTILUS_COMPRESSION_ZIP:
|
||||
+ {
|
||||
+ gtk_widget_grab_focus (self->zip_row);
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case NAUTILUS_COMPRESSION_ENCRYPTED_ZIP:
|
||||
+ {
|
||||
+ gtk_widget_grab_focus (self->encrypted_zip_row);
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case NAUTILUS_COMPRESSION_TAR_XZ:
|
||||
+ {
|
||||
+ gtk_widget_grab_focus (self->tar_xz_row);
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case NAUTILUS_COMPRESSION_7ZIP:
|
||||
+ {
|
||||
+ gtk_widget_grab_focus (self->seven_zip_row);
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ {
|
||||
+ g_assert_not_reached ();
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
NautilusCompressDialogController *
|
||||
nautilus_compress_dialog_controller_new (GtkWindow *parent_window,
|
||||
NautilusDirectory *destination_directory,
|
||||
@@ -361,9 +409,13 @@ nautilus_compress_dialog_controller_new (GtkWindow *parent_window,
|
||||
GtkWidget *name_entry;
|
||||
GtkWidget *activate_button;
|
||||
GtkWidget *extension_stack;
|
||||
+ GtkWidget *zip_row;
|
||||
GtkWidget *zip_label;
|
||||
+ GtkWidget *encrypted_zip_row;
|
||||
GtkWidget *encrypted_zip_label;
|
||||
+ GtkWidget *tar_xz_row;
|
||||
GtkWidget *tar_xz_label;
|
||||
+ GtkWidget *seven_zip_row;
|
||||
GtkWidget *seven_zip_label;
|
||||
GtkWidget *extension_popover;
|
||||
GtkWidget *zip_checkmark;
|
||||
@@ -392,6 +444,10 @@ nautilus_compress_dialog_controller_new (GtkWindow *parent_window,
|
||||
seven_zip_checkmark = GTK_WIDGET (gtk_builder_get_object (builder, "seven_zip_checkmark"));
|
||||
passphrase_label = GTK_WIDGET (gtk_builder_get_object (builder, "passphrase_label"));
|
||||
passphrase_entry = GTK_WIDGET (gtk_builder_get_object (builder, "passphrase_entry"));
|
||||
+ zip_row = GTK_WIDGET (gtk_builder_get_object (builder, "zip_row"));
|
||||
+ encrypted_zip_row = GTK_WIDGET (gtk_builder_get_object (builder, "encrypted_zip_row"));
|
||||
+ tar_xz_row = GTK_WIDGET (gtk_builder_get_object (builder, "tar_xz_row"));
|
||||
+ seven_zip_row = GTK_WIDGET (gtk_builder_get_object (builder, "seven_zip_row"));
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (compress_dialog),
|
||||
parent_window);
|
||||
@@ -420,6 +476,10 @@ nautilus_compress_dialog_controller_new (GtkWindow *parent_window,
|
||||
self->name_entry = name_entry;
|
||||
self->passphrase_label = passphrase_label;
|
||||
self->passphrase_entry = passphrase_entry;
|
||||
+ self->zip_row = zip_row;
|
||||
+ self->encrypted_zip_row = encrypted_zip_row;
|
||||
+ self->tar_xz_row = tar_xz_row;
|
||||
+ self->seven_zip_row = seven_zip_row;
|
||||
|
||||
self->response_handler_id = g_signal_connect (compress_dialog,
|
||||
"response",
|
||||
@@ -441,6 +501,8 @@ nautilus_compress_dialog_controller_new (GtkWindow *parent_window,
|
||||
G_CALLBACK (passphrase_entry_on_icon_press),
|
||||
"activate_button_on_sensitive_notify",
|
||||
G_CALLBACK (activate_button_on_sensitive_notify),
|
||||
+ "popover_on_show",
|
||||
+ G_CALLBACK (popover_on_show),
|
||||
NULL);
|
||||
gtk_builder_connect_signals (builder, self);
|
||||
|
||||
diff --git a/src/resources/ui/nautilus-compress-dialog.ui b/src/resources/ui/nautilus-compress-dialog.ui
|
||||
index a57765eed..a6bf9c1fb 100644
|
||||
--- a/src/resources/ui/nautilus-compress-dialog.ui
|
||||
+++ b/src/resources/ui/nautilus-compress-dialog.ui
|
||||
@@ -2,6 +2,7 @@
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.14"/>
|
||||
<object class="GtkPopover" id="extension_popover">
|
||||
+ <signal name="show" handler="popover_on_show"/>
|
||||
<property name="position">bottom</property>
|
||||
<property name="constrain-to">none</property>
|
||||
<child>
|
||||
@@ -12,7 +13,7 @@
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<child>
|
||||
- <object class="HdyActionRow">
|
||||
+ <object class="HdyActionRow" id="zip_row">
|
||||
<property name="visible">True</property>
|
||||
<property name="activatable">True</property>
|
||||
<property name="title" translatable="no">.zip</property>
|
||||
@@ -49,7 +50,7 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
- <object class="HdyActionRow">
|
||||
+ <object class="HdyActionRow" id="tar_xz_row">
|
||||
<property name="visible">True</property>
|
||||
<property name="activatable">True</property>
|
||||
<property name="title" translatable="no">.tar.xz</property>
|
||||
@@ -66,7 +67,7 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
- <object class="HdyActionRow">
|
||||
+ <object class="HdyActionRow" id="seven_zip_row">
|
||||
<property name="visible">True</property>
|
||||
<property name="activatable">True</property>
|
||||
<property name="title" translatable="no">.7z</property>
|
||||
--
|
||||
2.33.1
|
||||
|
@ -0,0 +1,52 @@
|
||||
From 203d24f1e57991340b2870b0b956922144f0152a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= <antoniojpfernandes@gmail.com>
|
||||
Date: Mon, 8 Nov 2021 18:48:47 +0000
|
||||
Subject: [PATCH] compress-dialog-controller: Fit popover fit on X11
|
||||
|
||||
Under X11, GTK3 cannot draw a GtkPopover outside of the main window area.
|
||||
|
||||
This means the popover for compress formats is clipped under X11.
|
||||
|
||||
As a workaround, make the window twice as tal when the popover is shown.
|
||||
|
||||
Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2018
|
||||
---
|
||||
src/nautilus-compress-dialog-controller.c | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
diff --git a/src/nautilus-compress-dialog-controller.c b/src/nautilus-compress-dialog-controller.c
|
||||
index 3f7711ccb..de83b3717 100644
|
||||
--- a/src/nautilus-compress-dialog-controller.c
|
||||
+++ b/src/nautilus-compress-dialog-controller.c
|
||||
@@ -21,6 +21,10 @@
|
||||
#include <gnome-autoar/gnome-autoar.h>
|
||||
#include <libhandy-1/handy.h>
|
||||
|
||||
+#ifdef GDK_WINDOWING_X11
|
||||
+#include <gdk/gdkx.h>
|
||||
+#endif
|
||||
+
|
||||
#include <eel/eel-vfs-extensions.h>
|
||||
|
||||
#include "nautilus-compress-dialog-controller.h"
|
||||
@@ -394,6 +398,17 @@ popover_on_show (GtkWidget *widget,
|
||||
}
|
||||
break;
|
||||
}
|
||||
+
|
||||
+#ifdef GDK_WINDOWING_X11
|
||||
+ if (GDK_IS_X11_DISPLAY (gdk_display_get_default ()))
|
||||
+ {
|
||||
+ int w, h;
|
||||
+
|
||||
+ /* Workaround for https://gitlab.gnome.org/GNOME/nautilus/-/issues/2018 */
|
||||
+ gtk_window_get_default_size (GTK_WINDOW (self->compress_dialog), &w, &h);
|
||||
+ gtk_window_resize (GTK_WINDOW (self->compress_dialog), w, h * 2);
|
||||
+ }
|
||||
+#endif
|
||||
}
|
||||
|
||||
NautilusCompressDialogController *
|
||||
--
|
||||
2.33.1
|
||||
|
@ -0,0 +1,113 @@
|
||||
From d4e00000d46e0407841424a478eab833cf59cc12 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Holy <oholy@redhat.com>
|
||||
Date: Fri, 24 Sep 2021 09:42:54 +0200
|
||||
Subject: [PATCH] file-operations: Do not offer skipping when extracting one
|
||||
file
|
||||
|
||||
In case of extraction failure, the "Skip" and "Cancel" actions are offered
|
||||
everytime, but skipping doesn't make sense when extracting one file only.
|
||||
Let's use the same approach as it is used also for other operations, which
|
||||
is based on total number of files and remaining files. Also the "Skip All"
|
||||
action will be offered as a side-effect of this change.
|
||||
---
|
||||
src/nautilus-file-operations.c | 38 ++++++++++++++++++++++------------
|
||||
1 file changed, 25 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
|
||||
index 14dcf64d0..c95748ccc 100644
|
||||
--- a/src/nautilus-file-operations.c
|
||||
+++ b/src/nautilus-file-operations.c
|
||||
@@ -210,6 +210,7 @@ typedef struct
|
||||
|
||||
guint64 archive_compressed_size;
|
||||
guint64 total_compressed_size;
|
||||
+ gint total_files;
|
||||
|
||||
NautilusExtractCallback done_callback;
|
||||
gpointer done_callback_data;
|
||||
@@ -8332,6 +8333,7 @@ extract_job_on_error (AutoarExtractor *extractor,
|
||||
GFile *source_file;
|
||||
GFile *destination;
|
||||
gint response_id;
|
||||
+ gint remaining_files;
|
||||
g_autofree gchar *basename = NULL;
|
||||
|
||||
source_file = autoar_extractor_get_source_file (extractor);
|
||||
@@ -8357,25 +8359,35 @@ extract_job_on_error (AutoarExtractor *extractor,
|
||||
g_object_unref (destination);
|
||||
}
|
||||
|
||||
+ if (extract_job->common.skip_all_error)
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
basename = get_basename (source_file);
|
||||
nautilus_progress_info_take_status (extract_job->common.progress,
|
||||
g_strdup_printf (_("Error extracting “%s”"),
|
||||
basename));
|
||||
|
||||
- response_id = run_warning ((CommonJob *) extract_job,
|
||||
- g_strdup_printf (_("There was an error while extracting “%s”."),
|
||||
- basename),
|
||||
- g_strdup (error->message),
|
||||
- NULL,
|
||||
- FALSE,
|
||||
- CANCEL,
|
||||
- SKIP,
|
||||
- NULL);
|
||||
+ remaining_files = g_list_length (g_list_find_custom (extract_job->source_files,
|
||||
+ source_file,
|
||||
+ (GCompareFunc) g_file_equal)) - 1;
|
||||
+ response_id = run_cancel_or_skip_warning ((CommonJob *) extract_job,
|
||||
+ g_strdup_printf (_("There was an error while extracting “%s”."),
|
||||
+ basename),
|
||||
+ g_strdup (error->message),
|
||||
+ NULL,
|
||||
+ extract_job->total_files,
|
||||
+ remaining_files);
|
||||
|
||||
if (response_id == 0 || response_id == GTK_RESPONSE_DELETE_EVENT)
|
||||
{
|
||||
abort_job ((CommonJob *) extract_job);
|
||||
}
|
||||
+ else if (response_id == 1)
|
||||
+ {
|
||||
+ extract_job->common.skip_all_error = TRUE;
|
||||
+ }
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -8607,7 +8619,6 @@ extract_task_thread_func (GTask *task,
|
||||
{
|
||||
ExtractJob *extract_job = task_data;
|
||||
GList *l;
|
||||
- gint total_files;
|
||||
g_autofree guint64 *archive_compressed_sizes = NULL;
|
||||
gint i;
|
||||
|
||||
@@ -8618,9 +8629,10 @@ extract_task_thread_func (GTask *task,
|
||||
nautilus_progress_info_set_details (extract_job->common.progress,
|
||||
_("Preparing to extract"));
|
||||
|
||||
- total_files = g_list_length (extract_job->source_files);
|
||||
+ extract_job->total_files = g_list_length (extract_job->source_files);
|
||||
|
||||
- archive_compressed_sizes = g_malloc0_n (total_files, sizeof (guint64));
|
||||
+ archive_compressed_sizes = g_malloc0_n (extract_job->total_files,
|
||||
+ sizeof (guint64));
|
||||
extract_job->total_compressed_size = 0;
|
||||
|
||||
for (l = extract_job->source_files, i = 0;
|
||||
@@ -8691,7 +8703,7 @@ extract_task_thread_func (GTask *task,
|
||||
|
||||
if (!job_aborted ((CommonJob *) extract_job))
|
||||
{
|
||||
- report_extract_final_progress (extract_job, total_files);
|
||||
+ report_extract_final_progress (extract_job, extract_job->total_files);
|
||||
}
|
||||
|
||||
if (extract_job->common.undo_info)
|
||||
--
|
||||
2.33.1
|
||||
|
@ -0,0 +1,113 @@
|
||||
From c3b8e0d6dee8ae8d86cbc47a0745b3e9b2b814e7 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Holy <oholy@redhat.com>
|
||||
Date: Fri, 24 Sep 2021 09:56:07 +0200
|
||||
Subject: [PATCH] file-operations: Fix progress when skipping during extraction
|
||||
|
||||
The progress is wrong when extracting multiple files and some of them
|
||||
are skipped. Let's try to fix this.
|
||||
---
|
||||
src/nautilus-file-operations.c | 35 ++++++++++++++++++++++++++--------
|
||||
1 file changed, 27 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
|
||||
index c95748ccc..5fc8af2f3 100644
|
||||
--- a/src/nautilus-file-operations.c
|
||||
+++ b/src/nautilus-file-operations.c
|
||||
@@ -205,6 +205,7 @@ typedef struct
|
||||
GFile *destination_directory;
|
||||
GList *output_files;
|
||||
gboolean destination_decided;
|
||||
+ gboolean extraction_failed;
|
||||
|
||||
gdouble base_progress;
|
||||
|
||||
@@ -8346,6 +8347,8 @@ extract_job_on_error (AutoarExtractor *extractor,
|
||||
return;
|
||||
}
|
||||
|
||||
+ extract_job->extraction_failed = TRUE;
|
||||
+
|
||||
/* It is safe to use extract_job->output_files->data only when the
|
||||
* extract_job->destination_decided variable was set, see comment in the
|
||||
* extract_job_on_decide_destination function.
|
||||
@@ -8571,8 +8574,7 @@ extract_job_on_scanned (AutoarExtractor *extractor,
|
||||
}
|
||||
|
||||
static void
|
||||
-report_extract_final_progress (ExtractJob *extract_job,
|
||||
- gint total_files)
|
||||
+report_extract_final_progress (ExtractJob *extract_job)
|
||||
{
|
||||
char *status;
|
||||
g_autofree gchar *basename_dest = NULL;
|
||||
@@ -8582,7 +8584,11 @@ report_extract_final_progress (ExtractJob *extract_job,
|
||||
extract_job->destination_directory);
|
||||
basename_dest = get_basename (extract_job->destination_directory);
|
||||
|
||||
- if (total_files == 1)
|
||||
+ /* The g_list_length function is used intentionally here instead of the
|
||||
+ * extract_job->total_files variable to avoid printing wrong basename in
|
||||
+ * the case of skipped files.
|
||||
+ */
|
||||
+ if (g_list_length (extract_job->source_files) == 1)
|
||||
{
|
||||
GFile *source_file;
|
||||
g_autofree gchar *basename = NULL;
|
||||
@@ -8597,8 +8603,8 @@ report_extract_final_progress (ExtractJob *extract_job,
|
||||
{
|
||||
status = g_strdup_printf (ngettext ("Extracted %'d file to “%s”",
|
||||
"Extracted %'d files to “%s”",
|
||||
- total_files),
|
||||
- total_files,
|
||||
+ extract_job->total_files),
|
||||
+ extract_job->total_files,
|
||||
basename_dest);
|
||||
}
|
||||
|
||||
@@ -8609,6 +8615,8 @@ report_extract_final_progress (ExtractJob *extract_job,
|
||||
g_strdup_printf (_("%s / %s"),
|
||||
formatted_size,
|
||||
formatted_size));
|
||||
+
|
||||
+ nautilus_progress_info_set_progress (extract_job->common.progress, 1, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -8690,6 +8698,7 @@ extract_task_thread_func (GTask *task,
|
||||
|
||||
extract_job->archive_compressed_size = archive_compressed_sizes[i];
|
||||
extract_job->destination_decided = FALSE;
|
||||
+ extract_job->extraction_failed = FALSE;
|
||||
|
||||
autoar_extractor_start (extractor,
|
||||
extract_job->common.cancellable);
|
||||
@@ -8697,13 +8706,23 @@ extract_task_thread_func (GTask *task,
|
||||
g_signal_handlers_disconnect_by_data (extractor,
|
||||
extract_job);
|
||||
|
||||
- extract_job->base_progress += (gdouble) extract_job->archive_compressed_size /
|
||||
- (gdouble) extract_job->total_compressed_size;
|
||||
+ if (!extract_job->extraction_failed)
|
||||
+ {
|
||||
+ extract_job->base_progress += (gdouble) extract_job->archive_compressed_size /
|
||||
+ (gdouble) extract_job->total_compressed_size;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ extract_job->total_files--;
|
||||
+ extract_job->base_progress *= extract_job->total_compressed_size;
|
||||
+ extract_job->total_compressed_size -= extract_job->archive_compressed_size;
|
||||
+ extract_job->base_progress /= extract_job->total_compressed_size;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (!job_aborted ((CommonJob *) extract_job))
|
||||
{
|
||||
- report_extract_final_progress (extract_job, extract_job->total_files);
|
||||
+ report_extract_final_progress (extract_job);
|
||||
}
|
||||
|
||||
if (extract_job->common.undo_info)
|
||||
--
|
||||
2.33.1
|
||||
|
@ -0,0 +1,70 @@
|
||||
From d09b34cde210c4f817d2442cc9378b1ddf73aee9 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Holy <oholy@redhat.com>
|
||||
Date: Fri, 24 Sep 2021 08:40:23 +0200
|
||||
Subject: [PATCH] file-operations: Remove leftover files after extraction
|
||||
failure
|
||||
|
||||
Empty, or corrupted files are left in the output directory in the case
|
||||
of extraction failure, e.g. when wrong password is supplied. This is
|
||||
in most cases undesired. Let's recursively delete all the leftover
|
||||
files in the case of extraction failure.
|
||||
|
||||
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1954
|
||||
---
|
||||
src/nautilus-file-operations.c | 17 +++++++++++++++++
|
||||
1 file changed, 17 insertions(+)
|
||||
|
||||
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
|
||||
index 7927bd504..13da2cb39 100644
|
||||
--- a/src/nautilus-file-operations.c
|
||||
+++ b/src/nautilus-file-operations.c
|
||||
@@ -204,6 +204,7 @@ typedef struct
|
||||
GList *source_files;
|
||||
GFile *destination_directory;
|
||||
GList *output_files;
|
||||
+ gboolean destination_decided;
|
||||
|
||||
gdouble base_progress;
|
||||
|
||||
@@ -8202,8 +8203,14 @@ extract_job_on_decide_destination (AutoarExtractor *extractor,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+ /* The extract_job->destination_decided variable signalizes whether the
|
||||
+ * extract_job->output_files list already contains the final location as
|
||||
+ * its first link. There is no way to get this over the AutoarExtractor
|
||||
+ * API currently.
|
||||
+ */
|
||||
extract_job->output_files = g_list_prepend (extract_job->output_files,
|
||||
decided_destination);
|
||||
+ extract_job->destination_decided = TRUE;
|
||||
|
||||
return g_object_ref (decided_destination);
|
||||
}
|
||||
@@ -8336,6 +8343,15 @@ extract_job_on_error (AutoarExtractor *extractor,
|
||||
return;
|
||||
}
|
||||
|
||||
+ /* It is safe to use extract_job->output_files->data only when the
|
||||
+ * extract_job->destination_decided variable was set, see comment in the
|
||||
+ * extract_job_on_decide_destination function.
|
||||
+ */
|
||||
+ if (extract_job->destination_decided)
|
||||
+ {
|
||||
+ delete_file_recursively (extract_job->output_files->data, NULL, NULL, NULL);
|
||||
+ }
|
||||
+
|
||||
basename = get_basename (source_file);
|
||||
nautilus_progress_info_take_status (extract_job->common.progress,
|
||||
g_strdup_printf (_("Error extracting “%s”"),
|
||||
@@ -8657,6 +8673,7 @@ extract_task_thread_func (GTask *task,
|
||||
extract_job);
|
||||
|
||||
extract_job->archive_compressed_size = archive_compressed_sizes[i];
|
||||
+ extract_job->destination_decided = FALSE;
|
||||
|
||||
autoar_extractor_start (extractor,
|
||||
extract_job->common.cancellable);
|
||||
--
|
||||
2.33.1
|
||||
|
@ -0,0 +1,74 @@
|
||||
From bdd317d999458fc35b23ee9c6141a9d0c9ec66f7 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Holy <oholy@redhat.com>
|
||||
Date: Fri, 24 Sep 2021 08:45:27 +0200
|
||||
Subject: [PATCH] file-operations: Simplify output files handling when
|
||||
extracting
|
||||
|
||||
Currently, output files are checked for existence. But the files are
|
||||
explicitely deleted in the case of extraction failure, so this extra
|
||||
check is no more needed. Let's drop the redundant check and just update
|
||||
the list when deleting the files.
|
||||
---
|
||||
src/nautilus-file-operations.c | 25 ++++++-------------------
|
||||
1 file changed, 6 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
|
||||
index 13da2cb39..14dcf64d0 100644
|
||||
--- a/src/nautilus-file-operations.c
|
||||
+++ b/src/nautilus-file-operations.c
|
||||
@@ -8330,6 +8330,7 @@ extract_job_on_error (AutoarExtractor *extractor,
|
||||
{
|
||||
ExtractJob *extract_job = user_data;
|
||||
GFile *source_file;
|
||||
+ GFile *destination;
|
||||
gint response_id;
|
||||
g_autofree gchar *basename = NULL;
|
||||
|
||||
@@ -8349,7 +8350,11 @@ extract_job_on_error (AutoarExtractor *extractor,
|
||||
*/
|
||||
if (extract_job->destination_decided)
|
||||
{
|
||||
- delete_file_recursively (extract_job->output_files->data, NULL, NULL, NULL);
|
||||
+ destination = extract_job->output_files->data;
|
||||
+ delete_file_recursively (destination, NULL, NULL, NULL);
|
||||
+ extract_job->output_files = g_list_delete_link (extract_job->output_files,
|
||||
+ extract_job->output_files);
|
||||
+ g_object_unref (destination);
|
||||
}
|
||||
|
||||
basename = get_basename (source_file);
|
||||
@@ -8602,7 +8607,6 @@ extract_task_thread_func (GTask *task,
|
||||
{
|
||||
ExtractJob *extract_job = task_data;
|
||||
GList *l;
|
||||
- GList *existing_output_files = NULL;
|
||||
gint total_files;
|
||||
g_autofree guint64 *archive_compressed_sizes = NULL;
|
||||
gint i;
|
||||
@@ -8690,23 +8694,6 @@ extract_task_thread_func (GTask *task,
|
||||
report_extract_final_progress (extract_job, total_files);
|
||||
}
|
||||
|
||||
- for (l = extract_job->output_files; l != NULL; l = l->next)
|
||||
- {
|
||||
- GFile *output_file;
|
||||
-
|
||||
- output_file = G_FILE (l->data);
|
||||
-
|
||||
- if (g_file_query_exists (output_file, NULL))
|
||||
- {
|
||||
- existing_output_files = g_list_prepend (existing_output_files,
|
||||
- g_object_ref (output_file));
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- g_list_free_full (extract_job->output_files, g_object_unref);
|
||||
-
|
||||
- extract_job->output_files = existing_output_files;
|
||||
-
|
||||
if (extract_job->common.undo_info)
|
||||
{
|
||||
if (extract_job->output_files)
|
||||
--
|
||||
2.33.1
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
Name: nautilus
|
||||
Version: 40.2
|
||||
Release: 3%{?dist}
|
||||
Release: 6%{?dist}
|
||||
Summary: File manager for GNOME
|
||||
|
||||
License: GPLv3+
|
||||
@ -18,6 +18,17 @@ Patch1: compress-dialog-Update-dialog-design.patch
|
||||
Patch2: compress-dialog-Add-support-for-encrypted-.zip.patch
|
||||
Patch3: compress-dialog-Backport-translations.patch
|
||||
|
||||
# https://gitlab.gnome.org/GNOME/nautilus/-/issues/1954
|
||||
Patch4: file-operations-Remove-leftover-files-after-extracti.patch
|
||||
Patch5: file-operations-Simplify-output-files-handling-when-.patch
|
||||
Patch6: file-operations-Do-not-offer-skipping-when-extractin.patch
|
||||
Patch7: file-operations-Fix-progress-when-skipping-during-ex.patch
|
||||
|
||||
# https://gitlab.gnome.org/GNOME/nautilus/-/issues/1944
|
||||
# https://gitlab.gnome.org/GNOME/nautilus/-/issues/2018
|
||||
Patch8: compress-dialog-Set-keyboard-focus-on-the-row-with-t.patch
|
||||
Patch9: compress-dialog-controller-Fit-popover-fit-on-X11.patch
|
||||
|
||||
BuildRequires: desktop-file-utils
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gettext
|
||||
@ -148,8 +159,17 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop
|
||||
%doc %{_datadir}/gtk-doc/html/libnautilus-extension/
|
||||
|
||||
%changelog
|
||||
* Fri Dec 10 2021 Ondrej Holy <oholy@redhat.com> - 40.2-6
|
||||
- Update Persian translation from upstream (#2003134)
|
||||
|
||||
* Wed Dec 08 2021 Ondrej Holy <oholy@redhat.com> - 40.2-5
|
||||
- Backport various upstream fixes for compress formats popover (#2029423)
|
||||
|
||||
* Wed Dec 08 2021 Ondrej Holy <oholy@redhat.com> - 40.2-4
|
||||
- Backport various upstream fixes for archive extraction (#1995615)
|
||||
|
||||
* Fri Sep 17 2021 Ondrej Holy <oholy@redhat.com> - 40.2-3
|
||||
- Backport translations for encrypted archives support (#1993015)
|
||||
- Backport translations for encrypted archives support (#2003134)
|
||||
|
||||
* Tue Aug 10 2021 Ondrej Holy <oholy@redhat.com> - 40.2-2
|
||||
- Add support for creation of password-protected archives (#1991575)
|
||||
|
Loading…
Reference in New Issue
Block a user