[tracker-miners/wip/carlosg/shuffle-libtracker-miner: 39/116] libtracker-miner: Avoid interning file for monitoring purposes



commit 24d405170a6a2403f76bdede920b3aafe687041f
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 file changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 0ff190c90..dc2f00f0b 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]