[tracker-miners/wip/carlosg/speed-track: 9/22] libtracker-miner: Remove existence check




commit 0c60dffd8156ce3ce6a435bb54a337498ee103cc
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Oct 17 00:22:02 2020 +0200

    libtracker-miner: Remove existence check
    
    When crawling over a directory, we first check that the directory
    exists. This is kinda pointless, as we can delay this error to
    the moment we open the enumerator.

 src/libtracker-miner/tracker-crawler.c | 12 ------------
 1 file changed, 12 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-crawler.c b/src/libtracker-miner/tracker-crawler.c
index bb4f211a6..d4cff0ac4 100644
--- a/src/libtracker-miner/tracker-crawler.c
+++ b/src/libtracker-miner/tracker-crawler.c
@@ -893,7 +893,6 @@ tracker_crawler_get (TrackerCrawler        *crawler,
        TrackerCrawlerPrivate *priv;
        DirectoryProcessingData *dir_data;
        DirectoryRootInfo *info;
-       gboolean enable_stat;
        GTask *task;
 
        g_return_if_fail (TRACKER_IS_CRAWLER (crawler));
@@ -901,8 +900,6 @@ tracker_crawler_get (TrackerCrawler        *crawler,
 
        priv = tracker_crawler_get_instance_private (crawler);
 
-       enable_stat = (flags & TRACKER_DIRECTORY_FLAG_NO_STAT) == 0;
-
        info = directory_root_info_new (file, priv->file_attributes, flags);
        task = g_task_new (crawler, cancellable, callback, user_data);
        g_task_set_task_data (task, info,
@@ -910,15 +907,6 @@ tracker_crawler_get (TrackerCrawler        *crawler,
        info->task = task;
        info->crawler = crawler;
 
-       if (enable_stat && !g_file_query_exists (file, NULL)) {
-               /* This shouldn't happen, unless the removal/unmount notification
-                * didn't yet reach the TrackerFileNotifier.
-                */
-               g_task_return_boolean (task, FALSE);
-               g_object_unref (task);
-               return;
-       }
-
        if (!check_directory (crawler, info, file)) {
                g_task_return_boolean (task, FALSE);
                g_object_unref (task);


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