[tracker/wip/carlosg/trigger-filter-parent-on-monitor-events: 3/3] libtracker-miner: Handle deletes of files triggering parent folder filters
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/trigger-filter-parent-on-monitor-events: 3/3] libtracker-miner: Handle deletes of files triggering parent folder filters
- Date: Sat, 2 Mar 2019 23:51:06 +0000 (UTC)
commit fbb40507f70e416164ad039c4c648166d59c14dd
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Mar 3 00:21:06 2019 +0100
libtracker-miner: Handle deletes of files triggering parent folder filters
Theoretically at least, since we don't have file monitors on the directory
in that case. The code is now correct at least.
src/libtracker-miner/tracker-file-notifier.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index b2960dab1..a0951cd73 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -1288,12 +1288,6 @@ monitor_item_deleted_cb (TrackerMonitor *monitor,
tracker_monitor_remove_recursively (priv->monitor, file);
}
- if (!tracker_indexing_tree_file_is_indexable (priv->indexing_tree,
- file, file_type)) {
- /* File was not indexed */
- return ;
- }
-
if (!is_directory) {
TrackerDirectoryFlags flags;
gboolean indexable;
@@ -1305,7 +1299,6 @@ monitor_item_deleted_cb (TrackerMonitor *monitor,
indexable = tracker_indexing_tree_parent_is_indexable (priv->indexing_tree,
parent, children);
- g_object_unref (parent);
g_list_free (children);
/* note: This supposedly works, but in practice
@@ -1317,15 +1310,23 @@ monitor_item_deleted_cb (TrackerMonitor *monitor,
/* New file was triggering a directory content
* filter, reindex parent directory altogether
*/
- file = tracker_file_system_get_file (priv->file_system,
- file,
- G_FILE_TYPE_DIRECTORY,
- NULL);
+ canonical = tracker_file_system_get_file (priv->file_system,
+ parent,
+ G_FILE_TYPE_DIRECTORY,
+ NULL);
tracker_indexing_tree_get_root (priv->indexing_tree,
- file, &flags);
- notifier_queue_root (notifier, file, flags, FALSE);
+ canonical, &flags);
+ notifier_queue_root (notifier, canonical, flags, FALSE);
return;
}
+
+ g_object_unref (parent);
+ }
+
+ if (!tracker_indexing_tree_file_is_indexable (priv->indexing_tree,
+ file, file_type)) {
+ /* File was not indexed */
+ return ;
}
/* Fetch the interned copy */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]