[tracker-miners/wip/carlosg/delay-monitors: 15/19] tracker-miner-fs: Minor refactors




commit 5a084b0dceb032c63a068e546e2aff1ecd8905ed
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Nov 8 20:32:40 2020 +0100

    tracker-miner-fs: Minor refactors
    
    We'll have different timeouts here handling rechecks, make some
    refactors to accomodate for that a bit better.

 src/miners/fs/tracker-miner-files.c | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)
---
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index 2b5d4d3f6..654759742 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -1660,28 +1660,32 @@ index_single_directories_cb (GObject    *gobject,
        private->index_single_directories = tracker_gslist_copy_with_string_data (new_dirs);
 }
 
-static gboolean
-miner_files_force_recheck_idle (gpointer user_data)
+static void
+tracker_miner_files_trigger_check (TrackerMinerFiles *mf)
 {
-       TrackerMinerFiles *miner_files = user_data;
-       TrackerIndexingTree *indexing_tree;
+       TrackerIndexingTree *tree;
        GList *roots, *l;
 
-       miner_files_update_filters (miner_files);
+       g_debug ("Triggering check on all indexed directories");
+       tree = tracker_miner_fs_get_indexing_tree (TRACKER_MINER_FS (mf));
+       roots = tracker_indexing_tree_list_roots (tree);
 
-       indexing_tree = tracker_miner_fs_get_indexing_tree (TRACKER_MINER_FS (miner_files));
-       roots = tracker_indexing_tree_list_roots (indexing_tree);
+       for (l = roots; l; l = l->next)
+               tracker_indexing_tree_notify_update (tree, l->data, FALSE);
 
-       for (l = roots; l; l = l->next) {
-               GFile *root = l->data;
+       g_list_free (roots);
+}
 
-               tracker_indexing_tree_notify_update (indexing_tree, root, FALSE);
-       }
+static gboolean
+miner_files_force_recheck_idle (gpointer user_data)
+{
+       TrackerMinerFiles *miner_files = user_data;
 
+       miner_files_update_filters (miner_files);
+       tracker_miner_files_trigger_check (miner_files);
        miner_files->private->force_recheck_id = 0;
-       g_list_free (roots);
 
-       return FALSE;
+       return G_SOURCE_REMOVE;
 }
 
 static void


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