[tracker/miner-fs-refactor: 62/110] libtracker-miner-fs: Add tracker_indexing_tree_file_is_root()



commit 8b614e184593f2b98ad5be7e1a8c89a2949bb3d2
Author: Carlos Garnacho <carlos lanedo com>
Date:   Mon Oct 3 14:54:48 2011 +0200

    libtracker-miner-fs: Add tracker_indexing_tree_file_is_root()

 src/libtracker-miner/tracker-indexing-tree.c |   16 ++++++++++++++++
 src/libtracker-miner/tracker-indexing-tree.h |    2 ++
 2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-indexing-tree.c b/src/libtracker-miner/tracker-indexing-tree.c
index d928133..9c4a15a 100644
--- a/src/libtracker-miner/tracker-indexing-tree.c
+++ b/src/libtracker-miner/tracker-indexing-tree.c
@@ -797,3 +797,19 @@ tracker_indexing_tree_get_root (TrackerIndexingTree   *tree,
 
 	return NULL;
 }
+
+gboolean
+tracker_indexing_tree_file_is_root (TrackerIndexingTree *tree,
+                                    GFile               *file)
+{
+	TrackerIndexingTreePrivate *priv;
+	GNode *node;
+
+	g_return_val_if_fail (TRACKER_IS_INDEXING_TREE (tree), FALSE);
+	g_return_val_if_fail (G_IS_FILE (file), FALSE);
+
+	priv = tree->priv;
+	node = find_directory_node (priv->config_tree, file,
+	                            (GEqualFunc) g_file_equal);
+	return node != NULL;
+}
diff --git a/src/libtracker-miner/tracker-indexing-tree.h b/src/libtracker-miner/tracker-indexing-tree.h
index 5c2ef9c..25f3aec 100644
--- a/src/libtracker-miner/tracker-indexing-tree.h
+++ b/src/libtracker-miner/tracker-indexing-tree.h
@@ -96,6 +96,8 @@ void                tracker_indexing_tree_set_default_policy (TrackerIndexingTre
 GFile *   tracker_indexing_tree_get_root             (TrackerIndexingTree   *tree,
                                                       GFile                 *file,
                                                       TrackerDirectoryFlags *directory_flags);
+gboolean  tracker_indexing_tree_file_is_root         (TrackerIndexingTree   *tree,
+                                                      GFile                 *file);
 
 G_END_DECLS
 



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