[gnome-utils/gsettings-tutorial: 15/22] [gsettings-tutorial] skip_scan_uri_list completely handled via GSettings



commit e4ffe3a0d9c6c08c15dabe738859b82b69a47ff4
Author: Vincent Untz <vuntz gnome org>
Date:   Fri Apr 16 18:40:55 2010 -0400

    [gsettings-tutorial] skip_scan_uri_list completely handled via GSettings
    
    This change is really similar to the previous one (799b83df).

 baobab/src/baobab.c |   20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/baobab/src/baobab.c b/baobab/src/baobab.c
index 71b2fca..bdc5bb9 100644
--- a/baobab/src/baobab.c
+++ b/baobab/src/baobab.c
@@ -669,22 +669,18 @@ static void
 store_excluded_locations (void)
 {
 	GSList *l;
-	GSList *uri_list = NULL;
+	GPtrArray *array;
 
-	for (l = baobab.excluded_locations; l != NULL; l = l->next) {
-		GSList *uri_list = NULL;
+	array = g_ptr_array_new_with_free_func (g_free);
 
-		uri_list = g_slist_prepend (uri_list, g_file_get_uri(l->data));
+	for (l = baobab.excluded_locations; l != NULL; l = l->next) {
+		g_ptr_array_add (array, g_file_get_uri (l->data));
 	}
 
-	gconf_client_set_list (baobab.gconf_client,
-			       PROPS_SCAN_KEY,
-			       GCONF_VALUE_STRING, 
-			       uri_list,
-			       NULL);
+	g_settings_set_strv (baobab.settings_properties, "skip_scan_uri_list",
+			     (const gchar * const *) array->pdata, array->len);
 
-	g_slist_foreach (uri_list, (GFunc) g_free, NULL);
-	g_slist_free (uri_list);
+	g_ptr_array_free (array, TRUE);
 }
 
 static void
@@ -693,7 +689,7 @@ sanity_check_excluded_locations (void)
 	GFile *root;
 	GSList *l;
 
-	/* Verify if gconf wrongly contains root dir exclusion, and remove it from gconf. */
+	/* Verify if setting wrongly contains root dir exclusion, and remove it if needed. */
 	root = g_file_new_for_uri ("file:///");
 
 	for (l = baobab.excluded_locations; l != NULL; l = l->next) {



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