[tracker/tracker-0.10] libtracker-miner: Ignore EVENT_MOVED during Writeback



commit 7558519e6da5496a3c21e1a0700e82684903ca14
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Jul 20 13:11:00 2011 +0200

    libtracker-miner: Ignore EVENT_MOVED during Writeback

 src/libtracker-miner/tracker-miner-fs.c |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 868e5ef..964fa57 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -145,6 +145,7 @@ typedef struct {
 	GCancellable *cancellable;
 	TrackerSparqlBuilder *builder;
 	TrackerMiner *miner;
+	gboolean is_writeback;
 } UpdateProcessingTaskContext;
 
 typedef struct {
@@ -3854,9 +3855,22 @@ monitor_item_moved_cb (TrackerMonitor *monitor,
                        gpointer        user_data)
 {
 	TrackerMinerFS *fs;
+	TrackerTask *task;
 
 	fs = user_data;
 
+	task = tracker_task_pool_find (fs->priv->task_pool, other_file);
+
+	/* When data is NULL, it's a writeback task, all others have a non-null
+	 * data segment. Whent he file-move happens, we can finally stop the
+	 * for-writeback ignoring of the file */
+
+	if (task && tracker_task_get_data (task) == NULL) {
+		tracker_task_pool_remove (fs->priv->task_pool, task);
+		tracker_task_unref (task);
+		return;
+	}
+
 	if (!is_source_monitored) {
 		if (is_directory) {
 			/* Remove monitors if any */
@@ -4848,10 +4862,10 @@ tracker_miner_fs_writeback_notify (TrackerMinerFS *fs,
 		            "signal didn't return FALSE for it",
 		            G_OBJECT_TYPE_NAME (fs), uri);
 		g_free (uri);
-	} else {
-		tracker_task_pool_remove (fs->priv->task_pool, task);
-		tracker_task_unref (task);
 	}
+
+	/* Check monitor_item_moved_cb  for the remainder of this notify */
+
 }
 
 /**



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