summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2020-09-13 13:25:24 +0100
committerAntónio Fernandes <antoniojpfernandes@gmail.com>2020-09-21 12:50:57 +0000
commit553e59f68bee7e112846696b78794a34281ec1b6 (patch)
tree9e333b77cd3921a56d3cfc9342f0c6621857fdda
parent36e505c12ce7057e444d929c96ac810ce85192e7 (diff)
downloadnautilus-553e59f68bee7e112846696b78794a34281ec1b6.tar.gz
file-utilities: Don't block main thread to restore from trash
The sync variants of file operations have been introduced for use in integration tests. The async operations have been suffixed _async(). However, likely by mistake, in the restore from trash operation, the call has been appended _sync rather than _async. [1] This blocks the main thread until the operation task finishes, causing a dead lock when the operation thread needs the main thread to show a conflict dialog. This happens when restoring a file from trash if a new file with the same name already exists in the original location. Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/790 [1] commit ab31018cdaeb1c592e1c46402c5ae1facc503151
-rw-r--r--src/nautilus-file-utilities.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nautilus-file-utilities.c b/src/nautilus-file-utilities.c
index e6a4b2e58..2ee6e7c05 100644
--- a/src/nautilus-file-utilities.c
+++ b/src/nautilus-file-utilities.c
@@ -818,9 +818,10 @@ ensure_dirs_task_ready_cb (GObject *_source,
files = g_hash_table_lookup (data->original_dirs_hash, original_dir);
locations = locations_from_file_list (files);
- nautilus_file_operations_move_sync
- (locations,
- original_dir_location);
+ nautilus_file_operations_move_async (locations,
+ original_dir_location,
+ data->parent_window,
+ NULL, NULL, NULL);
g_list_free_full (locations, g_object_unref);
g_object_unref (original_dir_location);