[tracker] libtracker-miner: Add indexing roots to the tree only when those are crawled



commit e70826c4ed0bb9a1121b37c8a5904ad5f4330c37
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue May 3 00:47:26 2016 +0200

    libtracker-miner: Add indexing roots to the tree only when those are crawled
    
    We must not insert information for indexing roots prior to their processing.
    This could be the case of indexing roots that are descendants of another
    recursive root (eg. ~/Music in ~/).
    
    This was inocuous when crawling the indexed folders from scratch, although
    could make indexing roots being spuriously deleted/reindexed when folders
    are reindexed (eg. because of TrackerIndexingTree::directory-updated signals)

 src/libtracker-miner/tracker-file-notifier.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index d391be0..6ce5725 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -456,9 +456,12 @@ file_notifier_add_node_foreach (GNode    *node,
                                           g_object_ref (canonical));
                }
 
-               if (depth != 0 || file == priv->current_index_root->root)
+               if (file == priv->current_index_root->root ||
+                   (depth != 0 &&
+                    !tracker_indexing_tree_file_is_root (priv->indexing_tree, file))) {
                        g_ptr_array_add (priv->current_index_root->query_files,
-                                        g_object_ref (canonical));
+                                        g_object_ref (canonical));
+               }
        }
 
        return FALSE;


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