[tracker/miner-fs-refactor: 27/93] tracker-miner-fs: Use filter policies in TrackerMinerApplications
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/miner-fs-refactor: 27/93] tracker-miner-fs: Use filter policies in TrackerMinerApplications
- Date: Fri, 7 Oct 2011 11:19:36 +0000 (UTC)
commit 8262f0fe4db90a9a592755d3fa8b241f8c4ef37c
Author: Carlos Garnacho <carlos lanedo com>
Date: Thu Sep 8 17:33:52 2011 +0200
tracker-miner-fs: Use filter policies in TrackerMinerApplications
Now all files are rejected, unless they match the *.desktop|*.directory
filter
src/miners/fs/tracker-miner-applications.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/miners/fs/tracker-miner-applications.c b/src/miners/fs/tracker-miner-applications.c
index 7a8870d..cdf7097 100644
--- a/src/miners/fs/tracker-miner-applications.c
+++ b/src/miners/fs/tracker-miner-applications.c
@@ -211,9 +211,24 @@ miner_applications_initable_init (GInitable *initable,
TrackerMinerFS *fs;
TrackerMinerApplications *app;
GError *inner_error = NULL;
+ TrackerIndexingTree *indexing_tree;
fs = TRACKER_MINER_FS (initable);
app = TRACKER_MINER_APPLICATIONS (initable);
+ indexing_tree = tracker_miner_fs_get_indexing_tree (fs);
+
+ /* Set up files filter, deny every file, but
+ * those with a .desktop/directory extension
+ */
+ tracker_indexing_tree_set_default_policy (indexing_tree,
+ TRACKER_FILTER_FILE,
+ TRACKER_FILTER_POLICY_DENY);
+ tracker_indexing_tree_add_filter (indexing_tree,
+ TRACKER_FILTER_FILE,
+ "*.desktop");
+ tracker_indexing_tree_add_filter (indexing_tree,
+ TRACKER_FILTER_FILE,
+ "*.directory");
/* Chain up parent's initable callback before calling child's one */
if (!miner_applications_initable_parent_iface->init (initable, cancellable, &inner_error)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]