[tracker: 1/3] libtracker-miner: Avoid crawling through children of non-recursive dir



commit 1bfeba6c36429d01135b9e6f45c5c1268cf17d5a
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Sep 9 19:01:24 2018 +0200

    libtracker-miner: Avoid crawling through children of non-recursive dir
    
    The direct children would be crawled, which is pretty useless.

 src/libtracker-miner/tracker-file-notifier.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 6d620a74e..eb6475ee1 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -444,7 +444,9 @@ file_notifier_add_node_foreach (GNode    *node,
 
                g_object_unref (file_info);
 
-               if (file_type == G_FILE_TYPE_DIRECTORY && !G_NODE_IS_ROOT (node)) {
+               if (file_type == G_FILE_TYPE_DIRECTORY &&
+                   (priv->current_index_root->flags & TRACKER_DIRECTORY_FLAG_RECURSE) != 0 &&
+                   !G_NODE_IS_ROOT (node)) {
                        /* Queue child dirs for later processing */
                        g_assert (node->children == NULL);
                        g_queue_push_tail (priv->current_index_root->pending_dirs,


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