[nautilus/alex-fazakas-duplicate-warning: 2/2] file-operations: Fix undo-duplicate critical
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/alex-fazakas-duplicate-warning: 2/2] file-operations: Fix undo-duplicate critical
- Date: Wed, 25 Jul 2018 14:56:20 +0000 (UTC)
commit 5b602f77a6d4fc1b51dd75d2ae67c98245be07b9
Author: Alexandru Fazakas <alex fazakas97 gmail com>
Date: Wed Jul 25 14:40:50 2018 +0300
file-operations: Fix undo-duplicate critical
While the undo information is set inside the duplicate function, the
copy one also tries setting it, creating a critical warning due to
the target directory being NULL.
This patch solves this issue by setting the undo info only if it
hasn't already been set.
src/nautilus-file-operations.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index 4ae4ca383..58997cd0d 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -5778,9 +5778,15 @@ nautilus_file_operations_copy (GTask *task,
GFile *src_dir;
src_dir = g_file_get_parent (job->files->data);
- job->common.undo_info = nautilus_file_undo_info_ext_new (NAUTILUS_FILE_UNDO_OP_COPY,
- g_list_length (job->files),
- src_dir, job->destination);
+ /* In the case of duplicate, the undo_info is already set, so we don't want to
+ * overwrite it wrongfully.
+ */
+ if (!job->common.undo_info)
+ {
+ job->common.undo_info = nautilus_file_undo_info_ext_new (NAUTILUS_FILE_UNDO_OP_COPY,
+ g_list_length (job->files),
+ src_dir, job->destination);
+ }
g_object_unref (src_dir);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]