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



commit 61e2affb01a8867b67e20fe45311694ecdd2e562
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Oct 23 16:18:33 2012 -0400

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

 configure.in                         |    2 +-
 eel/eel-glib-extensions.c            |   19 -------------------
 libnautilus-private/nautilus-file.c  |    6 +++---
 libnautilus-private/nautilus-query.c |    4 ++--
 src/nautilus-mime-actions.c          |    2 +-
 5 files changed, 7 insertions(+), 26 deletions(-)
---
diff --git a/configure.in b/configure.in
index f07b16d..48cd245 100644
--- a/configure.in
+++ b/configure.in
@@ -2,7 +2,7 @@ AC_PREREQ(2.54)
 
 dnl ===========================================================================
 
-m4_define(glib_minver,                 2.33.13)
+m4_define(glib_minver,                 2.34.0)
 m4_define(gnome_desktop_minver,        3.0.0)
 m4_define(pango_minver,                1.28.3)
 m4_define(gtk_minver,                  3.5.12)
diff --git a/eel/eel-glib-extensions.c b/eel/eel-glib-extensions.c
index f15cb49..36b8bcb 100644
--- a/eel/eel-glib-extensions.c
+++ b/eel/eel-glib-extensions.c
@@ -56,25 +56,6 @@ eel_g_str_list_equal (GList *list_a, GList *list_b)
 	return p == NULL && q == NULL;
 }
 
-/**
- * eel_g_str_list_copy
- *
- * @list: List of strings and/or NULLs to copy.
- * Return value: Deep copy of @list.
- **/
-GList *
-eel_g_str_list_copy (GList *list)
-{
-	GList *node, *result;
-
-	result = NULL;
-	
-	for (node = g_list_last (list); node != NULL; node = node->prev) {
-		result = g_list_prepend (result, g_strdup (node->data));
-	}
-	return result;
-}
-
 gboolean
 eel_g_strv_equal (char **a, char **b)
 {
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 4f5b2af..bfa3bc3 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -4718,7 +4718,7 @@ nautilus_file_get_directory_item_mime_types (NautilusFile *file,
 		return FALSE;
 	}
 
-	*mime_list = eel_g_str_list_copy (file->details->mime_list);
+	*mime_list = g_list_copy_deep (file->details->mime_list, (GCopyFunc) g_strdup, NULL);
 	return TRUE;
 }
 
@@ -6472,8 +6472,8 @@ nautilus_file_get_keywords (NautilusFile *file)
 
 	g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL);
 
-	keywords = eel_g_str_list_copy (file->details->extension_emblems);
-	keywords = g_list_concat (keywords, eel_g_str_list_copy (file->details->pending_extension_emblems));
+	keywords = g_list_copy_deep (file->details->extension_emblems, (GCopyFunc) g_strdup, NULL);
+	keywords = g_list_concat (keywords, g_list_copy_deep (file->details->pending_extension_emblems, (GCopyFunc) g_strdup, NULL));
 
 	metadata_keywords = nautilus_file_get_metadata_list (file, NAUTILUS_METADATA_KEY_EMBLEMS);
 	clean_up_metadata_keywords (file, &metadata_keywords);
diff --git a/libnautilus-private/nautilus-query.c b/libnautilus-private/nautilus-query.c
index 7a92c38..1393cd0 100644
--- a/libnautilus-private/nautilus-query.c
+++ b/libnautilus-private/nautilus-query.c
@@ -169,14 +169,14 @@ nautilus_query_set_location (NautilusQuery *query, const char *uri)
 GList *
 nautilus_query_get_mime_types (NautilusQuery *query)
 {
-	return eel_g_str_list_copy (query->details->mime_types);
+	return g_list_copy_deep (query->details->mime_types, (GCopyFunc) g_strdup, NULL);
 }
 
 void
 nautilus_query_set_mime_types (NautilusQuery *query, GList *mime_types)
 {
 	g_list_free_full (query->details->mime_types, g_free);
-	query->details->mime_types = eel_g_str_list_copy (mime_types);
+	query->details->mime_types = g_list_copy_deep (mime_types, (GCopyFunc) g_strdup, NULL);
 }
 
 void
diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c
index 5a838a0..ad4c950 100644
--- a/src/nautilus-mime-actions.c
+++ b/src/nautilus-mime-actions.c
@@ -217,7 +217,7 @@ application_launch_parameters_new (GAppInfo *application,
 
 	result = g_new0 (ApplicationLaunchParameters, 1);
 	result->application = g_object_ref (application);
-	result->uris = eel_g_str_list_copy (uris);
+	result->uris = g_list_copy_deep (uris, (GCopyFunc) g_strdup, NULL);
 
 	return result;
 }



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