[nautilus] all: don't use eel_g_object_list_copy()



commit 7af24a892cbe8641c8e4bf3d4fa17067b3cc9389
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Oct 23 16:13:58 2012 -0400

    all: don't use eel_g_object_list_copy()
    
    Use g_list_copy_deep() instead.

 eel/eel-glib-extensions.c                      |   13 -------------
 eel/eel-glib-extensions.h                      |    3 ---
 libnautilus-private/nautilus-file-operations.c |   10 +++++-----
 src/nautilus-view.c                            |    2 +-
 src/nautilus-window-slot.c                     |    4 ++--
 5 files changed, 8 insertions(+), 24 deletions(-)
---
diff --git a/eel/eel-glib-extensions.c b/eel/eel-glib-extensions.c
index 8008172..f15cb49 100644
--- a/eel/eel-glib-extensions.c
+++ b/eel/eel-glib-extensions.c
@@ -237,19 +237,6 @@ eel_g_hash_table_safe_for_each (GHashTable *hash_table,
 	g_list_free (flattened.values);
 }
 
-/**
- * eel_g_object_list_copy
- *
- * Copy the list of objects, ref'ing each one.
- * @list: GList of objects.
- **/
-GList *
-eel_g_object_list_copy (GList *list)
-{
-	g_list_foreach (list, (GFunc) g_object_ref, NULL);
-	return g_list_copy (list);
-}
-
 #if !defined (EEL_OMIT_SELF_CHECK)
 
 static gboolean
diff --git a/eel/eel-glib-extensions.h b/eel/eel-glib-extensions.h
index 05a78a5..9edaacb 100644
--- a/eel/eel-glib-extensions.h
+++ b/eel/eel-glib-extensions.h
@@ -50,9 +50,6 @@ gboolean    eel_g_str_list_equal                        (GList                 *
 							 GList                 *str_list_b);
 GList *     eel_g_str_list_copy                         (GList                 *str_list);
 
-/* List functions for lists of objects */
-GList *     eel_g_object_list_copy                      (GList                 *list);
-
 /* GHashTable functions */
 void        eel_g_hash_table_safe_for_each              (GHashTable            *hash_table,
 							 GHFunc                 callback,
diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c
index 811ff86..b60b748 100644
--- a/libnautilus-private/nautilus-file-operations.c
+++ b/libnautilus-private/nautilus-file-operations.c
@@ -1978,7 +1978,7 @@ trash_or_delete_internal (GList                  *files,
 	/* TODO: special case desktop icon link files ... */
 
 	job = op_job_new (DeleteJob, parent_window);
-	job->files = eel_g_object_list_copy (files);
+	job->files = g_list_copy_deep (files, (GCopyFunc) g_object_ref, NULL);
 	job->try_trash = try_trash;
 	job->user_cancel = FALSE;
 	job->done_callback = done_callback;
@@ -4656,7 +4656,7 @@ nautilus_file_operations_copy (GList *files,
 	job->desktop_location = nautilus_get_desktop_location ();
 	job->done_callback = done_callback;
 	job->done_callback_data = done_callback_data;
-	job->files = eel_g_object_list_copy (files);
+	job->files = g_list_copy_deep (files, (GCopyFunc) g_object_ref, NULL);
 	job->destination = g_object_ref (target_dir);
 	if (relative_item_points != NULL &&
 	    relative_item_points->len > 0) {
@@ -5194,7 +5194,7 @@ nautilus_file_operations_move (GList *files,
 	job->is_move = TRUE;
 	job->done_callback = done_callback;
 	job->done_callback_data = done_callback_data;
-	job->files = eel_g_object_list_copy (files);
+	job->files = g_list_copy_deep (files, (GCopyFunc) g_object_ref, NULL);
 	job->destination = g_object_ref (target_dir);
 	if (relative_item_points != NULL &&
 	    relative_item_points->len > 0) {
@@ -5520,7 +5520,7 @@ nautilus_file_operations_link (GList *files,
 	job = op_job_new (CopyMoveJob, parent_window);
 	job->done_callback = done_callback;
 	job->done_callback_data = done_callback_data;
-	job->files = eel_g_object_list_copy (files);
+	job->files = g_list_copy_deep (files, (GCopyFunc) g_object_ref, NULL);
 	job->destination = g_object_ref (target_dir);
 	if (relative_item_points != NULL &&
 	    relative_item_points->len > 0) {
@@ -5561,7 +5561,7 @@ nautilus_file_operations_duplicate (GList *files,
 	job = op_job_new (CopyMoveJob, parent_window);
 	job->done_callback = done_callback;
 	job->done_callback_data = done_callback_data;
-	job->files = eel_g_object_list_copy (files);
+	job->files = g_list_copy_deep (files, (GCopyFunc) g_object_ref, NULL);
 	job->destination = NULL;
 	if (relative_item_points != NULL &&
 	    relative_item_points->len > 0) {
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index c39d27e..40d05c5 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -2577,7 +2577,7 @@ nautilus_view_set_selection (NautilusView *nautilus_view,
 		 */
 		g_list_free_full (view->details->pending_selection, g_object_unref);
 		view->details->pending_selection =
-			eel_g_object_list_copy (selection);
+			g_list_copy_deep (selection, (GCopyFunc) g_object_ref, NULL);
 	}
 }
 
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 5ab01fa..3fa3586 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -876,7 +876,7 @@ begin_location_change (NautilusWindowSlot *slot,
 	slot->details->location_change_type = type;
 	slot->details->location_change_distance = distance;
 	slot->details->tried_mount = FALSE;
-	slot->details->pending_selection = eel_g_object_list_copy (new_selection);
+	slot->details->pending_selection = g_list_copy_deep (new_selection, (GCopyFunc) g_object_ref, NULL);
 
 	slot->details->pending_scroll_to = g_strdup (scroll_pos);
 
@@ -1397,7 +1397,7 @@ load_new_location (NautilusWindowSlot *slot,
 	g_assert (slot != NULL);
 	g_assert (location != NULL);
 
-	selection_copy = eel_g_object_list_copy (selection);
+	selection_copy = g_list_copy_deep (selection, (GCopyFunc) g_object_ref, NULL);
 	view = NULL;
 
 	nautilus_profile_start (NULL);



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