[tracker/miner-directory-flags: 2/8] libtracker-miner: Add mtime_check flag to TrackerDirectoryFlags



commit 59b4e68314755b367cd74e58eea45fbbfb69f372
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Apr 25 17:18:48 2011 +0200

    libtracker-miner: Add mtime_check flag to TrackerDirectoryFlags
    
    This flag forces the mtime check on a directory.

 src/libtracker-miner/tracker-miner-fs.c |   18 +++++++++++-------
 src/libtracker-miner/tracker-miner-fs.h |    1 +
 2 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index b910fa5..3201e5f 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -3475,9 +3475,10 @@ crawler_check_file_cb (TrackerCrawler *crawler,
 {
 	TrackerMinerFS *fs = user_data;
 
-	if (!fs->private->been_crawled &&
-	    (!fs->private->mtime_checking ||
-	     !fs->private->initial_crawling)) {
+	if ((fs->private->current_directory->flags & TRACKER_DIRECTORY_CHECK_MTIME) == 0 &&
+	    (!fs->private->been_crawled &&
+	     (!fs->private->mtime_checking ||
+	      !fs->private->initial_crawling))) {
 		return FALSE;
 	}
 
@@ -3512,9 +3513,10 @@ crawler_check_directory_cb (TrackerCrawler *crawler,
 	} else {
 		gboolean should_change_index;
 
-		if (!fs->private->been_crawled &&
-		    (!fs->private->mtime_checking ||
-		     !fs->private->initial_crawling)) {
+		if ((fs->private->current_directory->flags & TRACKER_DIRECTORY_CHECK_MTIME) == 0 &&
+		    (!fs->private->been_crawled &&
+		     (!fs->private->mtime_checking ||
+		      !fs->private->initial_crawling))) {
 			should_change_index = FALSE;
 		} else {
 			should_change_index = should_change_index_for_file (fs, file);
@@ -3577,7 +3579,9 @@ crawler_check_directory_contents_cb (TrackerCrawler *crawler,
 		 * -First crawl has already been done OR
 		 * -mtime_checking is TRUE.
 		 */
-		if (fs->private->been_crawled || fs->private->mtime_checking) {
+		if (fs->private->been_crawled ||
+		    (fs->private->current_directory->flags & TRACKER_DIRECTORY_CHECK_MTIME) != 0 ||
+		    fs->private->mtime_checking) {
 			/* Set quark so that before trying to add the item we first
 			 * check for its existence. */
 			g_object_set_qdata (G_OBJECT (parent),
diff --git a/src/libtracker-miner/tracker-miner-fs.h b/src/libtracker-miner/tracker-miner-fs.h
index 91165e9..da904b5 100644
--- a/src/libtracker-miner/tracker-miner-fs.h
+++ b/src/libtracker-miner/tracker-miner-fs.h
@@ -48,6 +48,7 @@ typedef struct _TrackerMinerFSPrivate TrackerMinerFSPrivate;
 typedef enum {
 	TRACKER_DIRECTORY_NONE              = 0,
 	TRACKER_DIRECTORY_RECURSE           = 1 << 0,
+	TRACKER_DIRECTORY_CHECK_MTIME       = 1 << 1
 } TrackerDirectoryFlags;
 
 /**



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