gnome-utils r7910 - in trunk/baobab: . src



Author: pborelli
Date: Sat May  3 17:04:37 2008
New Revision: 7910
URL: http://svn.gnome.org/viewvc/gnome-utils?rev=7910&view=rev

Log:
2008-05-03  Paolo Borelli  <pborelli katamail com>

	* src/baobab.c:
	* src/baobab.h:
	now that baobab-scan has been ported to gio baobab_is_excluded_dir
	can be removed.



Modified:
   trunk/baobab/ChangeLog
   trunk/baobab/src/baobab.c
   trunk/baobab/src/baobab.h

Modified: trunk/baobab/src/baobab.c
==============================================================================
--- trunk/baobab/src/baobab.c	(original)
+++ trunk/baobab/src/baobab.c	Sat May  3 17:04:37 2008
@@ -491,21 +491,6 @@
 	return ret;
 }
 
-gboolean
-baobab_is_excluded_dir (const gchar *uri)
-{
-	gboolean ret = FALSE;
-	GFile	*file;
-
-	g_return_val_if_fail (uri != NULL, FALSE);
-
-	file = g_file_new_for_uri (uri);
-	ret = baobab_is_excluded_location (file);
-	g_object_unref (file);
-
-	return ret;
-}
-
 void
 set_toolbar_visible (gboolean visible)
 {
@@ -659,11 +644,42 @@
 }
 
 static void
+sanity_check_excluded_locations (void)
+{
+	GFile *root;
+
+	/* Verify if gconf wrongly contains root dir exclusion, and remove it from gconf. */
+	root = g_file_new_for_uri ("file:///");
+	if (baobab_is_excluded_location (root)) {
+		GSList *uri_list, *l;
+
+		baobab.excluded_locations = g_slist_delete_link (baobab.excluded_locations, 
+						g_slist_find (baobab.excluded_locations, 
+							      root));
+
+		for (l = baobab.excluded_locations; l != NULL; l = l->next) {
+			uri_list = g_slist_prepend (uri_list, g_file_get_uri(l->data));
+		}
+		
+		gconf_client_set_list (baobab.gconf_client,
+				       PROPS_SCAN_KEY,
+				       GCONF_VALUE_STRING, 
+				       uri_list,
+				       NULL);
+
+		g_slist_foreach (uri_list, (GFunc) g_free, NULL);
+		g_slist_free (uri_list);
+	}
+
+	g_object_unref (root);
+}
+
+static void
 baobab_init (void)
 {
-	GSList	*uri_list, *l;
-	GError	*error = NULL;
-	GFile	*file;
+	GSList *uri_list;
+	GFile *file;
+	GError *error = NULL;
 	monitor_home = NULL;
 
 	/* Load Glade */
@@ -690,34 +706,13 @@
 						      PROPS_SCAN_KEY,
 						      GCONF_VALUE_STRING,
 						      NULL);
-	
-	baobab_set_excluded_locations(uri_list);
+
+	baobab_set_excluded_locations (uri_list);
 
 	g_slist_foreach (uri_list, (GFunc) g_free, NULL);
 	g_slist_free (uri_list);
 
-	/* Verify if gconf wrongly contains root dir exclusion, and remove it from gconf. */
-	if (baobab_is_excluded_dir ("file:///")) {
-		GFile 	*file;
-		
-		file = g_file_new_for_uri ("file:///");
-
-		baobab.excluded_locations = g_slist_delete_link (baobab.excluded_locations, 
-						g_slist_find (baobab.excluded_locations, 
-							file));
-		g_object_unref (file);
-		for (l = baobab.excluded_locations; l != NULL; l = l->next) {
-			uri_list = g_slist_prepend (uri_list, g_file_get_uri(l->data));
-		}
-		
-		gconf_client_set_list (baobab.gconf_client,
-				       PROPS_SCAN_KEY,
-				       GCONF_VALUE_STRING, 
-				       uri_list,
-				       NULL);
-		g_slist_foreach (uri_list, (GFunc) g_free, NULL);
-		g_slist_free (uri_list);
-	}
+	sanity_check_excluded_locations ();
 
 	baobab.bbEnableHomeMonitor = gconf_client_get_bool (baobab.gconf_client,
 							    PROPS_ENABLE_HOME_MONITOR,

Modified: trunk/baobab/src/baobab.h
==============================================================================
--- trunk/baobab/src/baobab.h	(original)
+++ trunk/baobab/src/baobab.h	Sat May  3 17:04:37 2008
@@ -98,7 +98,6 @@
 void fill_model (struct chan_data *);
 void first_row (void);
 gboolean baobab_is_excluded_location (GFile *);
-gboolean baobab_is_excluded_dir (const char *);
 void baobab_set_excluded_locations (GSList *);
 void set_toolbar_visible (gboolean visible);
 void set_statusbar_visible (gboolean visible);



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