tracker r2233 - in branches/indexer-split: . src/libtracker-common



Author: mr
Date: Mon Sep 15 16:36:16 2008
New Revision: 2233
URL: http://svn.gnome.org/viewvc/tracker?rev=2233&view=rev

Log:


Modified:
   branches/indexer-split/ChangeLog
   branches/indexer-split/src/libtracker-common/tracker-config.c
   branches/indexer-split/src/libtracker-common/tracker-config.h

Modified: branches/indexer-split/src/libtracker-common/tracker-config.c
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-config.c	(original)
+++ branches/indexer-split/src/libtracker-common/tracker-config.c	Mon Sep 15 16:36:16 2008
@@ -995,7 +995,9 @@
 	if (!error) {
 		g_object_set (G_OBJECT (config), property, value, NULL);
 	} else {
-		g_clear_error (&error);
+		g_warning ("Couldn't load config option '%s' (int) in group '%s', %s",
+			   property, group, error->message);
+		g_error_free (error);
 	}
 }
 
@@ -1013,6 +1015,8 @@
 	if (!error) {
 		g_object_set (G_OBJECT (config), property, value, NULL);
 	} else {
+		g_warning ("Couldn't load config option '%s' (bool) in group '%s', %s",
+			   property, group, error->message);
 		g_clear_error (&error);
 	}
 }
@@ -1031,7 +1035,9 @@
 	if (!error) {
 		g_object_set (G_OBJECT (config), property, value, NULL);
 	} else {
-		g_clear_error (&error);
+		g_warning ("Couldn't load config option '%s' (string) in group '%s', %s",
+			   property, group, error->message);
+		g_error_free (error);
 	}
 
 	g_free (value);
@@ -1143,6 +1149,7 @@
 	GError	             *error = NULL;
 	gchar	             *filename;
 	gchar	             *directory;
+	gboolean              value;
 
 	key_file = g_key_file_new ();
 
@@ -1226,6 +1233,44 @@
 	/* Services */
 	config_load_boolean (config, "enable-xesam", key_file, GROUP_SERVICES, KEY_ENABLE_XESAM);
 
+	/* 
+	 * Legacy options no longer supported: 
+	 */
+	value = g_key_file_get_boolean (key_file, "Emails", "IndexEvolutionEmails", &error);
+	if (!error) {
+		gchar * const modules[2] = { "evolution", NULL };
+	
+		g_message ("Legacy config option 'IndexEvolutionEmails' found");
+		g_message ("  This option has been replaced by 'DisabledModules'");
+
+		if (!value) {
+			tracker_config_add_disabled_modules (config, modules);
+			g_message ("  Option 'DisabledModules' added '%s'", modules[0]);
+		} else {
+			tracker_config_remove_disabled_modules (config, modules[0]);
+			g_message ("  Option 'DisabledModules' removed '%s'", modules[0]);
+		}
+	} else {
+		g_clear_error (&error);
+	}
+
+	value = g_key_file_get_boolean (key_file, "Emails", "IndexThunderbirdEmails", &error);
+	if (!error) {
+		g_message ("Legacy config option 'IndexThunderbirdEmails' found");
+		g_message ("  This option is no longer supported and has no effect");
+	} else {
+		g_clear_error (&error);
+	}
+
+	value = g_key_file_get_boolean (key_file, "Indexing", "SkipMountPoints", &error);
+	if (!error) {
+		g_message ("Legacy config option 'SkipMountPoints' found");
+		tracker_config_set_index_mounted_directories (config, !value);
+		g_message ("  Option 'IndexMountedDirectories' set to %s", !value ? "true" : "false");
+	} else {
+		g_clear_error (&error);
+	}
+
 	g_key_file_free (key_file);
 }
 
@@ -2141,3 +2186,26 @@
 
 	g_object_notify (G_OBJECT (config), "disabled-modules");
 }
+
+void
+tracker_config_remove_disabled_modules (TrackerConfig *config,
+					const gchar   *module)
+{
+	TrackerConfigPrivate *priv;
+	GSList               *l;
+
+	g_return_if_fail (TRACKER_IS_CONFIG (config));
+	g_return_if_fail (module != NULL);
+
+	priv = TRACKER_CONFIG_GET_PRIVATE (config);
+
+	l = g_slist_find_custom (priv->disabled_modules,
+				 module,
+				 (GCompareFunc) strcmp);
+
+	if (l) {
+		g_free (l->data);
+		priv->disabled_modules = g_slist_delete_link (priv->disabled_modules, l);
+		g_object_notify (G_OBJECT (config), "disabled-modules");
+	}
+}

Modified: branches/indexer-split/src/libtracker-common/tracker-config.h
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-config.h	(original)
+++ branches/indexer-split/src/libtracker-common/tracker-config.h	Mon Sep 15 16:36:16 2008
@@ -137,6 +137,8 @@
 								    gchar * const *roots);
 void           tracker_config_add_disabled_modules                 (TrackerConfig *config,
 								    gchar * const *modules);
+void           tracker_config_remove_disabled_modules              (TrackerConfig *config,
+								    const gchar   *module);
 
 G_END_DECLS
 



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