[tracker] TrackerMinerFiles: Prepare against missing configuration.



commit 166151293cc1ebacac4ffc297d5713bcd28815db
Author: Carlos Garnacho <carlos lanedo com>
Date:   Mon Mar 8 15:49:32 2010 +0100

    TrackerMinerFiles: Prepare against missing configuration.

 src/tracker-miner-fs/tracker-miner-files.c |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-miner-fs/tracker-miner-files.c b/src/tracker-miner-fs/tracker-miner-files.c
index 9dffe29..218eb45 100644
--- a/src/tracker-miner-fs/tracker-miner-files.c
+++ b/src/tracker-miner-fs/tracker-miner-files.c
@@ -333,9 +333,9 @@ miner_files_constructed (GObject *object)
 	mf = TRACKER_MINER_FILES (object);
 	fs = TRACKER_MINER_FS (object);
 
-	if (!mf->private->config) {
-		g_critical ("No config. This is mandatory");
-		g_assert_not_reached ();
+	if (G_UNLIKELY (!mf->private->config)) {
+		g_message ("No config for miner %p (%s).", object, G_OBJECT_TYPE_NAME (object));
+		return;
 	}
 
 	if (tracker_config_get_index_removable_devices (mf->private->config)) {
@@ -1184,6 +1184,10 @@ miner_files_check_file (TrackerMinerFS *fs,
 	/* Check module file ignore patterns */
 	mf = TRACKER_MINER_FILES (fs);
 
+	if (G_UNLIKELY (!mf->private->config)) {
+		return TRUE;
+	}
+
 	return tracker_miner_files_check_file (file,
 	                                       tracker_config_get_ignored_file_paths (mf->private->config),
 	                                       tracker_config_get_ignored_file_patterns (mf->private->config));
@@ -1198,6 +1202,10 @@ miner_files_check_directory (TrackerMinerFS *fs,
 	/* Check module file ignore patterns */
 	mf = TRACKER_MINER_FILES (fs);
 
+	if (G_UNLIKELY (!mf->private->config)) {
+		return TRUE;
+	}
+
 	return tracker_miner_files_check_directory (file,
 	                                            tracker_config_get_index_recursive_directories (mf->private->config),
 	                                            tracker_config_get_index_single_directories (mf->private->config),
@@ -1216,6 +1224,10 @@ miner_files_check_directory_contents (TrackerMinerFS *fs,
 
 	mf = TRACKER_MINER_FILES (fs);
 
+	if (G_UNLIKELY (!mf->private->config)) {
+		return TRUE;
+	}
+
 	return tracker_miner_files_check_directory_contents (parent,
 	                                                     children,
 	                                                     tracker_config_get_ignored_directories_with_content (mf->private->config));
@@ -1229,6 +1241,10 @@ miner_files_monitor_directory (TrackerMinerFS *fs,
 
 	mf = TRACKER_MINER_FILES (fs);
 
+	if (G_UNLIKELY (!mf->private->config)) {
+		return TRUE;
+	}
+
 	return tracker_miner_files_monitor_directory (file,
 	                                              tracker_config_get_enable_monitors (mf->private->config),
 	                                              mf->private->index_single_directories);



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