[tracker/live-config-changes: 2/6] TrackerMinerFS: Check both directory/contents before adding a monitor.



commit 4b3bea4662a17265624f5d059e3e46a32255b819
Author: Carlos Garnacho <carlos lanedo com>
Date:   Mon Mar 1 17:48:29 2010 +0100

    TrackerMinerFS: Check both directory/contents before adding a monitor.
    
    Without this change, monitors would be added on directories excluded
    by the IgnoredDirectoriesWithContent configuration option.

 src/libtracker-miner/tracker-miner-fs.c |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index d2ba5f3..e87fbd7 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2296,7 +2296,6 @@ crawler_check_directory_cb (TrackerCrawler *crawler,
 {
 	TrackerMinerFS *fs = user_data;
 	gboolean should_check, should_change_index;
-	gboolean add_monitor = TRUE;
 
 	should_check = should_check_file (fs, file, TRUE);
 	should_change_index = should_change_index_for_file (fs, file);
@@ -2311,15 +2310,6 @@ crawler_check_directory_cb (TrackerCrawler *crawler,
 		                    GINT_TO_POINTER (TRUE));
 	}
 
-	g_signal_emit (fs, signals[MONITOR_DIRECTORY], 0, file, &add_monitor);
-
-	/* FIXME: Should we add here or when we process the queue in
-	 * the finished sig?
-	 */
-	if (add_monitor) {
-		tracker_monitor_add (fs->private->monitor, file);
-	}
-
 	/* We _HAVE_ to check ALL directories because mtime updates
 	 * are not guaranteed on parents on Windows AND we on Linux
 	 * only the immediate parent directory mtime is updated, this
@@ -2342,6 +2332,19 @@ crawler_check_directory_contents_cb (TrackerCrawler *crawler,
 
 	g_signal_emit (fs, signals[CHECK_DIRECTORY_CONTENTS], 0, parent, children, &process);
 
+	if (process) {
+		gboolean add_monitor;
+
+		g_signal_emit (fs, signals[MONITOR_DIRECTORY], 0, parent, &add_monitor);
+
+		/* FIXME: Should we add here or when we process the queue in
+		 * the finished sig?
+		 */
+		if (add_monitor) {
+			tracker_monitor_add (fs->private->monitor, parent);
+		}
+	}
+
 	return process;
 }
 



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