[tracker/writeback-refactor-0.10: 31/63] libtracker-miner: Ignore EVENT_MOVED during Writeback
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/writeback-refactor-0.10: 31/63] libtracker-miner: Ignore EVENT_MOVED during Writeback
- Date: Thu, 28 Jul 2011 14:06:16 +0000 (UTC)
commit bd0cb6e1f9c578133f81e52a22986dbc00677f98
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 728a2f4..95babf8 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 */
@@ -4849,10 +4863,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]