[tracker/writeback-refactor-rebase] libtracker-miner: check writeback task pool when translating MOVED events to CREATED



commit 6fd2515dcf0c5bbf4462b6b3f13934b4e724af7a
Author: Carlos Garnacho <carlos lanedo com>
Date:   Wed Jul 20 17:58:01 2011 +0200

    libtracker-miner: check writeback task pool when translating MOVED events to CREATED
    
    A move event from an ignored file to a non-ignored one will be translated to a CREATED
    event, So check first whether there are no writeback tasks for the "new" file, since
    this is a common operation.

 src/libtracker-miner/tracker-miner-fs.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 54f662b..43aec2f 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -3908,12 +3908,14 @@ monitor_item_moved_cb (TrackerMonitor *monitor,
 				/* Source file was not stored, check dest file as new */
 				if (!is_directory ||
 				    !should_recurse_for_directory (fs, other_file)) {
-					trace_eq_push_tail ("CREATED", other_file, "On move monitor event");
-					tracker_priority_queue_add (fs->priv->items_created,
-					                            g_object_ref (other_file),
-					                            G_PRIORITY_DEFAULT);
-
-					item_queue_handlers_set_up (fs);
+					if (check_item_queues (fs, QUEUE_CREATED, other_file, NULL)) {
+						trace_eq_push_tail ("CREATED", other_file, "On move monitor event");
+						tracker_priority_queue_add (fs->priv->items_created,
+									    g_object_ref (other_file),
+									    G_PRIORITY_DEFAULT);
+
+						item_queue_handlers_set_up (fs);
+					}
 				} else {
 					tracker_miner_fs_directory_add_internal (fs, other_file,
 					                                         G_PRIORITY_DEFAULT);



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