[nautilus-actions] Move providers from GSList to GList



commit 2c57d848568bb68fd5d4e369db72c3fa6a1da3c8
Author: Pierre Wieser <pwieser trychlos org>
Date:   Sat Sep 26 21:59:45 2009 +0200

    Move providers from GSList to GList

 ChangeLog                    |    3 +++
 src/common/na-iio-provider.c |   10 +++++-----
 src/common/na-pivot.c        |   22 +++++++++++-----------
 src/common/na-pivot.h        |    4 ++--
 4 files changed, 21 insertions(+), 18 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 94ded93..f18396d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,8 +11,10 @@
 	* src/common/na-gconf-provider.c:
 	No more provide GConfClient from GConf provider.
 
+	* src/common/na-iio-provider.c:
 	* src/common/na-iio-provider.h:
 	No more define signals for preferences management.
+	Move providers from GSList to GList.
 
 	* src/common/na-ipivot-consumer.c:
 	* src/common/na-ipivot-consumer.h:
@@ -23,6 +25,7 @@
 	* src/common/na-pivot.c:
 	No more define signals for preferences management.
 	Move monitors from GSList to GList.
+	Move providers from GSList to GList.
 
 	* src/nact/base-builder.c:
 	* src/nact/base-builder.h: New files.
diff --git a/src/common/na-iio-provider.c b/src/common/na-iio-provider.c
index fb476dc..0f44ba0 100644
--- a/src/common/na-iio-provider.c
+++ b/src/common/na-iio-provider.c
@@ -54,7 +54,7 @@ static void     interface_base_finalize( NAIIOProviderInterface *klass );
 
 static GList   *build_hierarchy( GList *tree, GSList *level_zero, gboolean list_if_empty );
 static gint     search_item( const NAObject *obj, const gchar *uuid );
-static GList   *get_merged_items_list( const NAPivot *pivot, GSList *providers );
+static GList   *get_merged_items_list( const NAPivot *pivot, GList *providers );
 
 static guint    try_write_item( const NAIIOProvider *instance, NAObject *item, gchar **message );
 
@@ -156,7 +156,7 @@ GList *
 na_iio_provider_get_items_tree( const NAPivot *pivot )
 {
 	static const gchar *thisfn = "na_iio_provider_get_items_tree";
-	GSList *providers;
+	GList *providers;
 	GList *merged, *hierarchy;
 	GSList *level_zero;
 
@@ -256,9 +256,9 @@ search_item( const NAObject *obj, const gchar *uuid )
  * returns a concatened list of readen actions / menus
  */
 static GList *
-get_merged_items_list( const NAPivot *pivot, GSList *providers )
+get_merged_items_list( const NAPivot *pivot, GList *providers )
 {
-	GSList *ip;
+	GList *ip;
 	GList *merged = NULL;
 	GList *list, *item;
 	NAIIOProvider *instance;
@@ -303,7 +303,7 @@ na_iio_provider_write_item( const NAPivot *pivot, NAObject *item, gchar **messag
 	guint ret;
 	NAIIOProvider *instance;
 	NAIIOProvider *bad_instance;
-	GSList *providers, *ip;
+	GList *providers, *ip;
 
 	g_debug( "%s: pivot=%p (%s), item=%p (%s), message=%p", thisfn,
 			( void * ) pivot, G_OBJECT_TYPE_NAME( pivot ),
diff --git a/src/common/na-pivot.c b/src/common/na-pivot.c
index 5cb13cc..e53196b 100644
--- a/src/common/na-pivot.c
+++ b/src/common/na-pivot.c
@@ -65,7 +65,7 @@ struct NAPivotPrivate {
 	 * to pass NAPivot object to the IO provider, so that the later
 	 * is able to have access to the former (and its list of actions)
 	 */
-	GSList  *providers;
+	GList   *providers;
 
 	/* configuration tree
 	 */
@@ -330,7 +330,7 @@ na_pivot_dump( const NAPivot *pivot )
 	if( !pivot->private->dispose_has_run ){
 
 		g_debug( "%s: consumers=%p (%d elts)", thisfn, ( void * ) pivot->private->consumers, g_list_length( pivot->private->consumers ));
-		g_debug( "%s: providers=%p (%d elts)", thisfn, ( void * ) pivot->private->providers, g_slist_length( pivot->private->providers ));
+		g_debug( "%s: providers=%p (%d elts)", thisfn, ( void * ) pivot->private->providers, g_list_length( pivot->private->providers ));
 		g_debug( "%s:      tree=%p (%d elts)", thisfn, ( void * ) pivot->private->tree, g_list_length( pivot->private->tree ));
 
 		for( it = pivot->private->tree, i = 0 ; it ; it = it->next ){
@@ -352,12 +352,12 @@ na_pivot_dump( const NAPivot *pivot )
  *
  * The returned list should be release by calling na_pivot_free_providers().
  */
-GSList *
+GList *
 na_pivot_get_providers( const NAPivot *pivot, GType type )
 {
 	static const gchar *thisfn = "na_pivot_get_providers";
-	GSList *list = NULL;
-	GSList *ip;
+	GList *list = NULL;
+	GList *ip;
 
 	g_debug( "%s: pivot=%p", thisfn, ( void * ) pivot );
 	g_return_val_if_fail( NA_IS_PIVOT( pivot ), NULL );
@@ -366,7 +366,7 @@ na_pivot_get_providers( const NAPivot *pivot, GType type )
 
 		for( ip = pivot->private->providers ; ip ; ip = ip->next ){
 			if( G_TYPE_CHECK_INSTANCE_TYPE( G_OBJECT( ip->data ), type )){
-				list = g_slist_prepend( list, g_object_ref( ip->data ));
+				list = g_list_prepend( list, g_object_ref( ip->data ));
 			}
 		}
 	}
@@ -381,10 +381,10 @@ na_pivot_get_providers( const NAPivot *pivot, GType type )
  * Frees a list of providers as returned from na_pivot_get_providers().
  */
 void
-na_pivot_free_providers( GSList *providers )
+na_pivot_free_providers( GList *providers )
 {
-	g_slist_foreach( providers, ( GFunc ) g_object_unref, NULL );
-	g_slist_free( providers );
+	g_list_foreach( providers, ( GFunc ) g_object_unref, NULL );
+	g_list_free( providers );
 }
 
 /**
@@ -681,13 +681,13 @@ static void
 register_io_providers( NAPivot *pivot )
 {
 	static const gchar *thisfn = "na_pivot_register_io_providers";
-	GSList *list = NULL;
+	GList *list = NULL;
 
 	g_debug( "%s: pivot=%p", thisfn, ( void * ) pivot );
 	g_return_if_fail( NA_IS_PIVOT( pivot ));
 	g_return_if_fail( !pivot->private->dispose_has_run );
 
-	list = g_slist_prepend( list, na_gconf_provider_new( pivot ));
+	list = g_list_prepend( list, na_gconf_provider_new( pivot ));
 
 	pivot->private->providers = list;
 }
diff --git a/src/common/na-pivot.h b/src/common/na-pivot.h
index d02ecba..5638247 100644
--- a/src/common/na-pivot.h
+++ b/src/common/na-pivot.h
@@ -107,8 +107,8 @@ GType     na_pivot_get_type( void );
 NAPivot  *na_pivot_new( const NAIPivotConsumer *notified );
 void      na_pivot_dump( const NAPivot *pivot );
 
-GSList   *na_pivot_get_providers( const NAPivot *pivot, GType type );
-void      na_pivot_free_providers( GSList *providers );
+GList    *na_pivot_get_providers( const NAPivot *pivot, GType type );
+void      na_pivot_free_providers( GList *providers );
 
 GList    *na_pivot_get_items( const NAPivot *pivot );
 void      na_pivot_reload_items( NAPivot *pivot );



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