[tracker/wip/miner-internal-config: 2/3] libtracker-miner: Add tracker_miner_fs_get_indexing_tree()



commit 320f26587e06dfd12113091aae35f7509523acc0
Author: Carlos Garnacho <carlos lanedo com>
Date:   Fri Jul 29 15:43:54 2011 +0200

    libtracker-miner: Add tracker_miner_fs_get_indexing_tree()
    
    The returned object is owned by the miner, and will be internally
    used to find out whether files should be processed.

 src/libtracker-miner/tracker-miner-fs.c |   26 ++++++++++++++++++++++++++
 src/libtracker-miner/tracker-miner-fs.h |    3 +++
 2 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 71bbefd..a85563b 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -234,6 +234,8 @@ struct _TrackerMinerFSPrivate {
 	/* Files to check if no longer exist */
 	GHashTable     *check_removed;
 
+	TrackerIndexingTree *indexing_tree;
+
 	/* Status */
 	guint           been_started : 1;     /* TRUE if miner has been started */
 	guint           been_crawled : 1;     /* TRUE if initial crawling has been
@@ -742,6 +744,9 @@ tracker_miner_fs_init (TrackerMinerFS *object)
 	priv->task_pool = tracker_task_pool_new (DEFAULT_WAIT_POOL_LIMIT);
 	priv->writeback_pool = tracker_task_pool_new (DEFAULT_WAIT_POOL_LIMIT);
 
+	/* Create the indexing tree */
+	priv->indexing_tree = tracker_indexing_tree_new ();
+
 	/* Set up the crawlers now we have config and hal */
 	priv->crawler = tracker_crawler_new ();
 
@@ -761,6 +766,7 @@ tracker_miner_fs_init (TrackerMinerFS *object)
 	                  G_CALLBACK (crawler_finished_cb),
 	                  object);
 
+
 	/* Set up the monitor */
 	priv->monitor = tracker_monitor_new ();
 
@@ -922,6 +928,8 @@ fs_finalize (GObject *object)
 		g_hash_table_unref (priv->check_removed);
 	}
 
+	g_object_unref (priv->indexing_tree);
+
 #ifdef EVENT_QUEUE_ENABLE_TRACE
 	if (priv->queue_status_timeout_id)
 		g_source_remove (priv->queue_status_timeout_id);
@@ -5443,6 +5451,24 @@ tracker_miner_fs_add_directory_without_parent (TrackerMinerFS *fs,
 	                                                   parent);
 }
 
+/**
+ * tracker_miner_fs_get_indexing_tree:
+ * @fs: a #TrackerMinerFS
+ *
+ * Returns the #TrackerIndexingTree which determines
+ * what files/directories are indexed by @fs
+ *
+ * Returns: (transfer none): The #TrackerIndexingTree
+ *          holding the indexing configuration
+ **/
+TrackerIndexingTree *
+tracker_miner_fs_get_indexing_tree (TrackerMinerFS *fs)
+{
+	g_return_val_if_fail (TRACKER_IS_MINER_FS (fs), NULL);
+
+	return fs->priv->indexing_tree;
+}
+
 /* Returns TRUE if the given GFile is actually the REAL parent
  * of a GFile without parent notified before */
 static gboolean
diff --git a/src/libtracker-miner/tracker-miner-fs.h b/src/libtracker-miner/tracker-miner-fs.h
index cdaeb7d..af40a91 100644
--- a/src/libtracker-miner/tracker-miner-fs.h
+++ b/src/libtracker-miner/tracker-miner-fs.h
@@ -30,6 +30,7 @@
 #include <libtracker-sparql/tracker-sparql.h>
 
 #include "tracker-miner-object.h"
+#include "tracker-indexing-tree.h"
 
 #include "tracker-miner-common.h"
 
@@ -166,6 +167,8 @@ gboolean              tracker_miner_fs_has_items_to_process (TrackerMinerFS *fs)
 void                  tracker_miner_fs_add_directory_without_parent (TrackerMinerFS *fs,
                                                                      GFile          *file);
 
+TrackerIndexingTree * tracker_miner_fs_get_indexing_tree    (TrackerMinerFS *fs);
+
 G_END_DECLS
 
 #endif /* __LIBTRACKER_MINER_MINER_FS_H__ */



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