From 2f527d20df097f77438429dd2d0982f8d48fa8c3 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Jan 08 2021 06:13:08 +0000 Subject: Apply patch 0008-dbus-manager-Drop-copy-file-operation.patch patch_name: 0008-dbus-manager-Drop-copy-file-operation.patch present_in_specfile: true location_in_specfile: 8 --- diff --git a/data/dbus-interfaces.xml b/data/dbus-interfaces.xml index 2133bb9..20ffadd 100644 --- a/data/dbus-interfaces.xml +++ b/data/dbus-interfaces.xml @@ -29,12 +29,6 @@ " - - - - - - diff --git a/src/nautilus-dbus-manager.c b/src/nautilus-dbus-manager.c index 0d51372..1ac6e12 100644 --- a/src/nautilus-dbus-manager.c +++ b/src/nautilus-dbus-manager.c @@ -61,40 +61,6 @@ nautilus_dbus_manager_dispose (GObject *object) G_OBJECT_CLASS (nautilus_dbus_manager_parent_class)->dispose (object); } -static gboolean -handle_copy_file (NautilusDBusFileOperations *object, - GDBusMethodInvocation *invocation, - const gchar *source_uri, - const gchar *source_display_name, - const gchar *dest_dir_uri, - const gchar *dest_name) -{ - GFile *source_file, *target_dir; - const gchar *target_name = NULL, *source_name = NULL; - - source_file = g_file_new_for_uri (source_uri); - target_dir = g_file_new_for_uri (dest_dir_uri); - - if (dest_name != NULL && dest_name[0] != '\0') - { - target_name = dest_name; - } - - if (source_display_name != NULL && source_display_name[0] != '\0') - { - source_name = source_display_name; - } - - nautilus_file_operations_copy_file (source_file, target_dir, source_name, target_name, - NULL, NULL, NULL); - - g_object_unref (source_file); - g_object_unref (target_dir); - - nautilus_dbus_file_operations_complete_copy_file (object, invocation); - return TRUE; /* invocation was handled */ -} - static void undo_redo_on_finished (gpointer user_data) { @@ -173,9 +139,9 @@ handle_create_folder (NautilusDBusFileOperations *object, } static void -copy_on_finished (GHashTable *debutting_uris, - gboolean success, - gpointer callback_data) +copy_move_on_finished (GHashTable *debutting_uris, + gboolean success, + gpointer callback_data) { g_application_release (g_application_get_default ()); } @@ -196,7 +162,30 @@ handle_copy_uris (NautilusDBusFileOperations *object, g_application_hold (g_application_get_default ()); nautilus_file_operations_copy_move (source_files, destination, - GDK_ACTION_COPY, NULL, copy_on_finished, NULL); + GDK_ACTION_COPY, NULL, copy_move_on_finished, NULL); + + g_list_free_full (source_files, g_free); + nautilus_dbus_file_operations_complete_copy_uris (object, invocation); + return TRUE; /* invocation was handled */ +} + +static gboolean +handle_move_uris (NautilusDBusFileOperations *object, + GDBusMethodInvocation *invocation, + const gchar **sources, + const gchar *destination) +{ + GList *source_files = NULL; + gint idx; + + for (idx = 0; sources[idx] != NULL; idx++) + { + source_files = g_list_prepend (source_files, g_strdup (sources[idx])); + } + + g_application_hold (g_application_get_default ()); + nautilus_file_operations_copy_move (source_files, destination, + GDK_ACTION_MOVE, NULL, copy_move_on_finished, NULL); g_list_free_full (source_files, g_free); nautilus_dbus_file_operations_complete_copy_uris (object, invocation); @@ -254,8 +243,8 @@ nautilus_dbus_manager_init (NautilusDBusManager *self) G_CALLBACK (handle_copy_uris), self); g_signal_connect (self->file_operations, - "handle-copy-file", - G_CALLBACK (handle_copy_file), + "handle-move-uris", + G_CALLBACK (handle_move_uris), self); g_signal_connect (self->file_operations, "handle-empty-trash", diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c index cf5e7f4..e306e7e 100644 --- a/src/nautilus-file-operations.c +++ b/src/nautilus-file-operations.c @@ -5706,47 +5706,6 @@ copy_task_thread_func (GTask *task, } void -nautilus_file_operations_copy_file (GFile *source_file, - GFile *target_dir, - const gchar *source_display_name, - const gchar *new_name, - GtkWindow *parent_window, - NautilusCopyCallback done_callback, - gpointer done_callback_data) -{ - GTask *task; - CopyMoveJob *job; - - job = op_job_new (CopyMoveJob, parent_window); - job->done_callback = done_callback; - job->done_callback_data = done_callback_data; - job->files = g_list_append (NULL, g_object_ref (source_file)); - job->destination = g_object_ref (target_dir); - /* Need to indicate the destination for the operation notification open - * button. */ - nautilus_progress_info_set_destination (((CommonJob *) job)->progress, target_dir); - job->target_name = g_strdup (new_name); - job->debuting_files = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal, g_object_unref, NULL); - - if (source_display_name != NULL) - { - gchar *path; - - path = g_build_filename ("/", source_display_name, NULL); - job->fake_display_source = g_file_new_for_path (path); - - g_free (path); - } - - inhibit_power_manager ((CommonJob *) job, _("Copying Files")); - - task = g_task_new (NULL, job->common.cancellable, copy_task_done, job); - g_task_set_task_data (task, job, NULL); - g_task_run_in_thread (task, copy_task_thread_func); - g_object_unref (task); -} - -void nautilus_file_operations_copy (GList *files, GFile *target_dir, GtkWindow *parent_window, diff --git a/src/nautilus-file-operations.h b/src/nautilus-file-operations.h index e8c6ed3..2a9c6a6 100644 --- a/src/nautilus-file-operations.h +++ b/src/nautilus-file-operations.h @@ -57,13 +57,6 @@ void nautilus_file_operations_copy_move (const GList *item_uris, GtkWidget *parent_view, NautilusCopyCallback done_callback, gpointer done_callback_data); -void nautilus_file_operations_copy_file (GFile *source_file, - GFile *target_dir, - const gchar *source_display_name, - const gchar *new_name, - GtkWindow *parent_window, - NautilusCopyCallback done_callback, - gpointer done_callback_data); void nautilus_file_operations_empty_trash (GtkWidget *parent_view); void nautilus_file_operations_new_folder (GtkWidget *parent_view, const char *parent_dir_uri,