[tracker] libtracker-miner: Avoid interning file for monitoring purposes



commit 0264aff09dcafede0fdb58426eaad67db47f4332
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Oct 24 22:32:23 2017 +0200

    libtracker-miner: Avoid interning file for monitoring purposes
    
    It doesn't bring any gains to use interned files when adding
    directories to the TrackerMonitor. Just use the GFile we get
    and avoid interning the directory this soon.

 src/libtracker-miner/tracker-file-notifier.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 1dbbb19..1b3028c 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -245,22 +245,17 @@ crawler_check_directory_contents_cb (TrackerCrawler *crawler,
                                                             parent, children);
        if (process) {
                TrackerDirectoryFlags parent_flags;
-               GFile *canonical;
                gboolean add_monitor;
 
-               canonical = tracker_file_system_get_file (priv->file_system,
-                                                         parent,
-                                                         G_FILE_TYPE_DIRECTORY,
-                                                         NULL);
                tracker_indexing_tree_get_root (priv->indexing_tree,
-                                               canonical, &parent_flags);
+                                               parent, &parent_flags);
 
                add_monitor = (parent_flags & TRACKER_DIRECTORY_FLAG_MONITOR) != 0;
 
                if (add_monitor) {
-                       tracker_monitor_add (priv->monitor, canonical);
+                       tracker_monitor_add (priv->monitor, parent);
                } else {
-                       tracker_monitor_remove (priv->monitor, canonical);
+                       tracker_monitor_remove (priv->monitor, parent);
                }
        } else {
                priv->current_index_root->current_dir_content_filtered = TRUE;


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