[nautilus] dbus-manager: Drop copy file operation
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] dbus-manager: Drop copy file operation
- Date: Tue, 7 Aug 2018 19:29:46 +0000 (UTC)
commit 60c3f2ea839deaf3040872d1ee43d4fea22d543b
Author: Carlos Soriano <csoriano redhat com>
Date: Tue Aug 7 21:25:01 2018 +0200
dbus-manager: Drop copy file operation
It was truly unreliable and not working clearly. We have a more powerful
and simpler API with CopyURIs, so there is no point to have this one.
This commits drops the DBus API. Note that the DBus version is not
bumped, I believe this DBus API is not used by any external service
given how broken was it.
data/dbus-interfaces.xml | 6 ------
src/nautilus-dbus-manager.c | 38 --------------------------------------
src/nautilus-file-operations.c | 41 -----------------------------------------
src/nautilus-file-operations.h | 7 -------
4 files changed, 92 deletions(-)
---
diff --git a/data/dbus-interfaces.xml b/data/dbus-interfaces.xml
index 2133bb99c..20ffadde1 100644
--- a/data/dbus-interfaces.xml
+++ b/data/dbus-interfaces.xml
@@ -29,12 +29,6 @@
</method>
<method name='EmptyTrash'>
</method>"
- <method name='CopyFile'>
- <arg type='s' name='SourceFileURI' direction='in'/>
- <arg type='s' name='SourceDisplayName' direction='in'/>
- <arg type='s' name='DestinationDirectoryURI' direction='in'/>
- <arg type='s' name='DestinationDisplayName' direction='in'/>
- </method>
<method name='TrashFiles'>
<arg type='as' name='URIs' direction='in'/>
</method>
diff --git a/src/nautilus-dbus-manager.c b/src/nautilus-dbus-manager.c
index 652c4203c..8d72ecfb9 100644
--- a/src/nautilus-dbus-manager.c
+++ b/src/nautilus-dbus-manager.c
@@ -54,40 +54,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)
{
@@ -246,10 +212,6 @@ nautilus_dbus_manager_init (NautilusDBusManager *self)
"handle-copy-uris",
G_CALLBACK (handle_copy_uris),
self);
- g_signal_connect (self->file_operations,
- "handle-copy-file",
- G_CALLBACK (handle_copy_file),
- self);
g_signal_connect (self->file_operations,
"handle-empty-trash",
G_CALLBACK (handle_empty_trash),
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index 66313beef..5951d0040 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -5780,47 +5780,6 @@ nautilus_file_operations_copy (GTask *task,
&source_info, &transfer_info);
}
-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, nautilus_file_operations_copy);
- g_object_unref (task);
-}
-
void
nautilus_file_operations_copy_sync (GList *files,
GFile *target_dir,
diff --git a/src/nautilus-file-operations.h b/src/nautilus-file-operations.h
index 96a69d631..5eaa95bdd 100644
--- a/src/nautilus-file-operations.h
+++ b/src/nautilus-file-operations.h
@@ -56,13 +56,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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]