[tracker] libtracker-miner: Fix content filter with default policy=deny
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-miner: Fix content filter with default policy=deny
- Date: Tue, 14 Nov 2017 22:25:39 +0000 (UTC)
commit 472215a31e2b7bfcc4320c55657330ad81178f6e
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Oct 18 22:45:10 2017 +0200
libtracker-miner: Fix content filter with default policy=deny
We deemed the directory as bad whenever any file didn't match the
filter, but files that don't match the filter should not trigger
it in one way or another.
src/libtracker-miner/tracker-indexing-tree.c | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-indexing-tree.c b/src/libtracker-miner/tracker-indexing-tree.c
index 42f6955..59f4399 100644
--- a/src/libtracker-miner/tracker-indexing-tree.c
+++ b/src/libtracker-miner/tracker-indexing-tree.c
@@ -917,23 +917,31 @@ tracker_indexing_tree_parent_is_indexable (TrackerIndexingTree *tree,
GFile *parent,
GList *children)
{
+ TrackerIndexingTreePrivate *priv;
+ gboolean has_match = FALSE;
+
+ g_return_val_if_fail (TRACKER_IS_INDEXING_TREE (tree), FALSE);
+ g_return_val_if_fail (G_IS_FILE (parent), FALSE);
+
+ priv = tree->priv;
+
if (!tracker_indexing_tree_file_is_indexable (tree,
parent,
G_FILE_TYPE_DIRECTORY)) {
return FALSE;
}
- while (children) {
- if (indexing_tree_file_is_filtered (tree,
- TRACKER_FILTER_PARENT_DIRECTORY,
- children->data)) {
- return FALSE;
- }
-
+ while (children && !has_match) {
+ has_match = tracker_indexing_tree_file_matches_filter (tree,
+ TRACKER_FILTER_PARENT_DIRECTORY,
+ children->data);
children = children->next;
}
- return TRUE;
+ if (priv->policies[TRACKER_FILTER_PARENT_DIRECTORY] == TRACKER_FILTER_POLICY_ACCEPT)
+ return !has_match;
+ else
+ return has_match;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]