[nautilus/wip/antoniof/try-admin-backend-for-file-ops: 5/11] file-operations: Remove unused parameter




commit 7f92422ed41fbd8b345b9ad0e140bebe744c5174
Author: Sachin Daluja <30343-sachindaluja users noreply gitlab gnome org>
Date:   Sat Jun 12 11:11:07 2021 -0400

    file-operations: Remove unused parameter
    
    From NautilusDeleteCallback function signature.

 src/nautilus-dbus-manager.c         | 10 ++++------
 src/nautilus-file-operations.c      | 12 ++++++------
 src/nautilus-file-operations.h      |  4 ++--
 src/nautilus-file-undo-operations.c | 12 +++++-------
 src/nautilus-files-view.c           |  3 +--
 5 files changed, 18 insertions(+), 23 deletions(-)
---
diff --git a/src/nautilus-dbus-manager.c b/src/nautilus-dbus-manager.c
index 6736205d1..c45df8864 100644
--- a/src/nautilus-dbus-manager.c
+++ b/src/nautilus-dbus-manager.c
@@ -355,9 +355,8 @@ handle_empty_trash2 (NautilusDBusFileOperations2 *object,
 }
 
 static void
-trash_on_finished (GHashTable *debutting_uris,
-                   gboolean    user_cancel,
-                   gpointer    callback_data)
+trash_on_finished (gboolean user_cancel,
+                   gpointer callback_data)
 {
     g_application_release (g_application_get_default ());
 }
@@ -409,9 +408,8 @@ handle_trash_uris2 (NautilusDBusFileOperations2  *object,
 }
 
 static void
-delete_on_finished (GHashTable *debutting_uris,
-                    gboolean    user_cancel,
-                    gpointer    callback_data)
+delete_on_finished (gboolean user_cancel,
+                    gpointer callback_data)
 {
     g_application_release (g_application_get_default ());
 }
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index fead1c8e7..9ad170e50 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -2525,7 +2525,6 @@ delete_task_done (GObject      *source_object,
                   gpointer      user_data)
 {
     DeleteJob *job;
-    GHashTable *debuting_uris;
 
     job = user_data;
 
@@ -2533,9 +2532,7 @@ delete_task_done (GObject      *source_object,
 
     if (job->done_callback)
     {
-        debuting_uris = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal, g_object_unref, NULL);
-        job->done_callback (debuting_uris, job->user_cancel, job->done_callback_data);
-        g_hash_table_unref (debuting_uris);
+        job->done_callback (job->user_cancel, job->done_callback_data);
     }
 
     finalize_common ((CommonJob *) job);
@@ -7325,12 +7322,15 @@ typedef struct
 } MoveTrashCBData;
 
 static void
-callback_for_move_to_trash (GHashTable      *debuting_uris,
-                            gboolean         user_cancelled,
+callback_for_move_to_trash (gboolean         user_cancelled,
                             MoveTrashCBData *data)
 {
     if (data->real_callback)
     {
+        g_autoptr (GHashTable) debuting_uris = NULL;
+
+        debuting_uris = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal, g_object_unref, NULL);
+
         data->real_callback (debuting_uris, !user_cancelled, data->real_data);
     }
     g_slice_free (MoveTrashCBData, data);
diff --git a/src/nautilus-file-operations.h b/src/nautilus-file-operations.h
index 24b8005d8..111a14e34 100644
--- a/src/nautilus-file-operations.h
+++ b/src/nautilus-file-operations.h
@@ -37,10 +37,10 @@ typedef void (* NautilusCopyCallback)      (GHashTable *debuting_uris,
 typedef void (* NautilusCreateCallback)    (GFile      *new_file,
                                            gboolean    success,
                                            gpointer    callback_data);
+/*TODO: Consolidate NautilusOpCallback and NautilusDeleteCallback*/
 typedef void (* NautilusOpCallback)        (gboolean    success,
                                            gpointer    callback_data);
-typedef void (* NautilusDeleteCallback)    (GHashTable *debuting_uris,
-                                           gboolean    user_cancel,
+typedef void (* NautilusDeleteCallback)    (gboolean   user_cancel,
                                            gpointer    callback_data);
 typedef void (* NautilusMountCallback)     (GVolume    *volume,
                                            gboolean    success,
diff --git a/src/nautilus-file-undo-operations.c b/src/nautilus-file-undo-operations.c
index 41abe2935..9aa28366b 100644
--- a/src/nautilus-file-undo-operations.c
+++ b/src/nautilus-file-undo-operations.c
@@ -384,9 +384,8 @@ file_undo_info_operation_callback (NautilusFile *file,
 }
 
 static void
-file_undo_info_delete_callback (GHashTable *debuting_uris,
-                                gboolean    user_cancel,
-                                gpointer    user_data)
+file_undo_info_delete_callback (gboolean user_cancel,
+                                gpointer user_data)
 {
     NautilusFileUndoInfo *self = user_data;
 
@@ -1638,9 +1637,8 @@ trash_strings_func (NautilusFileUndoInfo  *info,
 }
 
 static void
-trash_redo_func_callback (GHashTable *debuting_uris,
-                          gboolean    user_cancel,
-                          gpointer    user_data)
+trash_redo_func_callback (gboolean user_cancel,
+                          gpointer user_data)
 {
     NautilusFileUndoInfoTrash *self = user_data;
     GHashTable *new_trashed_files;
@@ -1673,7 +1671,7 @@ trash_redo_func_callback (GHashTable *debuting_uris,
         self->trashed = new_trashed_files;
     }
 
-    file_undo_info_delete_callback (debuting_uris, user_cancel, user_data);
+    file_undo_info_delete_callback (user_cancel, user_data);
 }
 
 static void
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 4e57ae61e..7aa0e60be 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -4890,8 +4890,7 @@ home_dir_in_selection (GList *selection)
 }
 
 static void
-trash_or_delete_done_cb (GHashTable        *debuting_uris,
-                         gboolean           user_cancel,
+trash_or_delete_done_cb (gboolean           user_cancel,
                          NautilusFilesView *view)
 {
     NautilusFilesViewPrivate *priv;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]