[tracker] Fixes NB#181421: Duplicates when monitor events processed before directory is created in store
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] Fixes NB#181421: Duplicates when monitor events processed before directory is created in store
- Date: Thu, 5 Aug 2010 18:47:30 +0000 (UTC)
commit 9a9c69ce4cfc0a1056cf8837409e1da8a20c538b
Author: Aleksander Morgado <aleksander lanedo com>
Date: Thu Aug 5 20:38:05 2010 +0200
Fixes NB#181421: Duplicates when monitor events processed before directory is created in store
src/libtracker-miner/tracker-miner-fs.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 12d9116..cd29579 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -3036,6 +3036,19 @@ crawler_check_directory_contents_cb (TrackerCrawler *crawler,
* the finished sig?
*/
if (add_monitor) {
+ /* Before adding the monitor, start notifying the store
+ * about the new directory, so that if any file event comes
+ * afterwards, the directory is already in store. */
+ g_queue_push_tail (fs->private->items_created,
+ g_object_ref (parent));
+ item_queue_handlers_set_up (fs);
+
+ /* As we already added here, specify that it shouldn't be added
+ * any more */
+ g_object_set_qdata (G_OBJECT (parent),
+ fs->private->quark_ignore_file,
+ GINT_TO_POINTER (TRUE));
+
tracker_monitor_add (fs->private->monitor, parent);
} else {
tracker_monitor_remove (fs->private->monitor, parent);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]