[tracker-miners/wip/carlosg/shuffle-libtracker-miner: 83/116] libtracker-miner: Avoid crawling through children of non-recursive dir



commit 98df0932326fed08896e549145f04c96c005b098
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 108528482..f809f8fea 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]