[tracker/writeback-refactor-rebase: 31/65] libtracker-miner: Ignore EVENT_MOVED during Writeback



commit aba5588f6cb1123595fffce41c8bef5457709ea6
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 6a1fdd8..bdebb2d 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 {
@@ -3808,9 +3809,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 */
@@ -4805,10 +4819,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]