[nautilus-actions] na_iprefs_get_io_providers() is moved to na-io-provider.c



commit 8465ce21b7b52087857e641017efa713d2fa086d
Author: Pierre Wieser <pwieser trychlos org>
Date:   Tue Jan 17 20:39:07 2012 +0100

    na_iprefs_get_io_providers() is moved to na-io-provider.c

 ChangeLog                 |    9 +++++++
 src/core/na-io-provider.c |   53 ++++++++++++++++++++++++++++++++++++++++++++-
 src/core/na-iprefs.c      |   51 -------------------------------------------
 src/core/na-iprefs.h      |    2 -
 4 files changed, 61 insertions(+), 54 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 37daad0..ebb5dae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-01-17 Pierre Wieser <pwieser trychlos org>
+
+	Move public na_iprefs_get_io_providers() function to static one.
+
+	* src/core/na-iprefs.c:
+	* src/core/na-iprefs.h (na_iprefs_get_io_providers): Removed function.
+
+	* src/core/na-io-provider.c (io_providers_get_from_prefs): New function.
+
 2012-01-16 Pierre Wieser <pwieser trychlos org>
 
 	* src/nact/nact-add-capability-dialog.c:
diff --git a/src/core/na-io-provider.c b/src/core/na-io-provider.c
index 11a4de3..95b650a 100644
--- a/src/core/na-io-provider.c
+++ b/src/core/na-io-provider.c
@@ -89,6 +89,7 @@ static void          dump_providers_list( GList *providers );
 static NAIOProvider *io_provider_new( const NAPivot *pivot, NAIIOProvider *module, const gchar *id );
 static GList        *io_providers_list_add_from_plugins( const NAPivot *pivot, GList *list );
 static GList        *io_providers_list_add_from_prefs( const NAPivot *pivot, GList *objects_list );
+static GSList       *io_providers_get_from_prefs( void );
 static GList        *io_providers_list_add_from_write_order( const NAPivot *pivot, GList *objects_list );
 static GList        *io_providers_list_append_object( const NAPivot *pivot, GList *list, NAIIOProvider *module, const gchar *id );
 static void          io_providers_list_set_module( const NAPivot *pivot, NAIOProvider *provider_object, NAIIOProvider *provider_module );
@@ -800,7 +801,7 @@ io_providers_list_add_from_prefs( const NAPivot *pivot, GList *objects_list )
 	GSList *io_providers, *it;
 
 	merged = objects_list;
-	io_providers = na_iprefs_get_io_providers();
+	io_providers = io_providers_get_from_prefs();
 
 	for( it = io_providers ; it ; it = it->next ){
 		id = ( const gchar * ) it->data;
@@ -813,6 +814,56 @@ io_providers_list_add_from_prefs( const NAPivot *pivot, GList *objects_list )
 }
 
 /*
+ * io_providers_get_from_prefs:
+ *
+ * Searches in preferences system for all mentions of an i/o provider.
+ * This does not mean in any way that the i/o provider is active,
+ * available or so, but just that is mentioned here.
+ *
+ * I/o provider identifiers returned in the list are not supposed
+ * to be unique, nor sorted.
+ *
+ * Returns: a list of i/o provider identifiers found in preferences
+ * system; this list should be na_core_utils_slist_free() by the caller.
+ *
+ * Since: 3.1
+ */
+static GSList *
+io_providers_get_from_prefs( void )
+{
+	GSList *providers;
+	GSList *write_order, *groups;
+	GSList *it;
+	const gchar *name;
+	gchar *group_prefix;
+	guint prefix_len;
+
+	providers = NULL;
+
+	write_order = na_settings_get_string_list( NA_IPREFS_IO_PROVIDERS_WRITE_ORDER, NULL, NULL );
+	for( it = write_order ; it ; it = it->next ){
+		name = ( const gchar * ) it->data;
+		providers = g_slist_prepend( providers, g_strdup( name ));
+	}
+	na_core_utils_slist_free( write_order );
+
+	groups = na_settings_get_groups();
+
+	group_prefix = g_strdup_printf( "%s ", NA_IPREFS_IO_PROVIDER_GROUP );
+	prefix_len = strlen( group_prefix );
+	for( it = groups ; it ; it = it->next ){
+		name = ( const gchar * ) it->data;
+		if( g_str_has_prefix( name, group_prefix )){
+			providers = g_slist_prepend( providers, g_strdup( name+prefix_len ));
+		}
+	}
+	g_free( group_prefix );
+	na_core_utils_slist_free( groups );
+
+	return( providers );
+}
+
+/*
  * adding from write-order means we only create NAIOProvider objects
  * without having any pointer to the underlying NAIIOProvider (if it exists)
  */
diff --git a/src/core/na-iprefs.c b/src/core/na-iprefs.c
index f595d23..bd88327 100644
--- a/src/core/na-iprefs.c
+++ b/src/core/na-iprefs.c
@@ -120,57 +120,6 @@ na_iprefs_set_order_mode( guint mode )
 }
 
 /*
- * na_iprefs_get_io_providers:
- * @pivot: the #NAPivot application object.
- *
- * Searches in preferences system for all mentions of an i/o provider.
- * This does not mean in any way that the i/o provider is active,
- * available or so, but just that is mentioned here.
- *
- * I/o provider identifiers returned in the list are not supposed
- * to be unique, nor sorted.
- *
- * Returns: a list of i/o provider identifiers found in preferences
- * system; this list should be na_core_utils_slist_free() by the caller.
- *
- * Since: 3.1
- */
-GSList *
-na_iprefs_get_io_providers( void )
-{
-	GSList *providers;
-	GSList *write_order, *groups;
-	GSList *it;
-	const gchar *name;
-	gchar *group_prefix;
-	guint prefix_len;
-
-	providers = NULL;
-
-	write_order = na_settings_get_string_list( NA_IPREFS_IO_PROVIDERS_WRITE_ORDER, NULL, NULL );
-	for( it = write_order ; it ; it = it->next ){
-		name = ( const gchar * ) it->data;
-		providers = g_slist_prepend( providers, g_strdup( name ));
-	}
-	na_core_utils_slist_free( write_order );
-
-	groups = na_settings_get_groups();
-
-	group_prefix = g_strdup_printf( "%s ", NA_IPREFS_IO_PROVIDER_GROUP );
-	prefix_len = strlen( group_prefix );
-	for( it = groups ; it ; it = it->next ){
-		name = ( const gchar * ) it->data;
-		if( g_str_has_prefix( name, group_prefix )){
-			providers = g_slist_prepend( providers, g_strdup( name+prefix_len ));
-		}
-	}
-	g_free( group_prefix );
-	na_core_utils_slist_free( groups );
-
-	return( providers );
-}
-
-/*
  * na_iprefs_write_level_zero:
  * @items: the #GList of items whose first level is to be written.
  * @messages: a pointer to a #GSList in which we will add happening
diff --git a/src/core/na-iprefs.h b/src/core/na-iprefs.h
index 85cbd13..ac12265 100644
--- a/src/core/na-iprefs.h
+++ b/src/core/na-iprefs.h
@@ -56,8 +56,6 @@ guint    na_iprefs_get_order_mode         ( gboolean *mandatory );
 guint    na_iprefs_get_order_mode_by_label( const gchar *label );
 void     na_iprefs_set_order_mode         ( guint mode );
 
-GSList  *na_iprefs_get_io_providers       ( void );
-
 gboolean na_iprefs_write_level_zero       ( const GList *items, GSList **messages );
 
 G_END_DECLS



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