[tracker/tracker-1.2] libtracker-miner: Fix API break with tracker_indexing_tree_new()
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-1.2] libtracker-miner: Fix API break with tracker_indexing_tree_new()
- Date: Wed, 24 Sep 2014 16:17:30 +0000 (UTC)
commit 8c6485a312ffbd1c9bb3c95d5933284f56990045
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Wed Sep 24 09:57:55 2014 +0100
libtracker-miner: Fix API break with tracker_indexing_tree_new()
Previously it took void and it was changed to take a GFile.
https://bugzilla.gnome.org/show_bug.cgi?id=737243
.../libtracker-miner/libtracker-miner-sections.txt | 1 +
src/libtracker-miner/tracker-indexing-tree.c | 23 ++++++++++++++++++-
src/libtracker-miner/tracker-indexing-tree.h | 4 ++-
src/libtracker-miner/tracker-miner-fs.c | 2 +-
src/libtracker-miner/tracker-miner.vapi | 4 ++-
.../libtracker-miner/tracker-file-notifier-test.c | 2 +-
.../libtracker-miner/tracker-indexing-tree-test.c | 2 +-
7 files changed, 31 insertions(+), 7 deletions(-)
---
diff --git a/docs/reference/libtracker-miner/libtracker-miner-sections.txt
b/docs/reference/libtracker-miner/libtracker-miner-sections.txt
index 4892d72..da04be1 100644
--- a/docs/reference/libtracker-miner/libtracker-miner-sections.txt
+++ b/docs/reference/libtracker-miner/libtracker-miner-sections.txt
@@ -122,6 +122,7 @@ tracker_file_enumerator_get_type
TrackerIndexingTree
TrackerIndexingTreeClass
tracker_indexing_tree_new
+tracker_indexing_tree_new_with_root
tracker_indexing_tree_add
tracker_indexing_tree_remove
tracker_indexing_tree_add_filter
diff --git a/src/libtracker-miner/tracker-indexing-tree.c b/src/libtracker-miner/tracker-indexing-tree.c
index c303e6b..d47326c 100644
--- a/src/libtracker-miner/tracker-indexing-tree.c
+++ b/src/libtracker-miner/tracker-indexing-tree.c
@@ -313,14 +313,33 @@ tracker_indexing_tree_init (TrackerIndexingTree *tree)
/**
* tracker_indexing_tree_new:
+ *
+ * Returns a newly created #TrackerIndexingTree
+ *
+ * Returns: a newly allocated #TrackerIndexingTree
+ *
+ * Since: 0.14.0
+ **/
+TrackerIndexingTree *
+tracker_indexing_tree_new (void)
+{
+ return g_object_new (TRACKER_TYPE_INDEXING_TREE, NULL);
+}
+
+/**
+ * tracker_indexing_tree_new_with_root:
* @root: The top level URL
*
- * If @root is %NULL, the default value is 'file:///'.
+ * If @root is %NULL, the default value is 'file:///'. Using %NULL
+ * here is the equivalent to calling tracker_indexing_tree_new() which
+ * takes no @root argument.
*
* Returns: a newly allocated #TrackerIndexingTree
+ *
+ * Since: 1.2.2
**/
TrackerIndexingTree *
-tracker_indexing_tree_new (GFile *root)
+tracker_indexing_tree_new_with_root (GFile *root)
{
return g_object_new (TRACKER_TYPE_INDEXING_TREE,
"root", root,
diff --git a/src/libtracker-miner/tracker-indexing-tree.h b/src/libtracker-miner/tracker-indexing-tree.h
index 1f6533c..a569167 100644
--- a/src/libtracker-miner/tracker-indexing-tree.h
+++ b/src/libtracker-miner/tracker-indexing-tree.h
@@ -77,7 +77,9 @@ typedef struct {
GType tracker_indexing_tree_get_type (void) G_GNUC_CONST;
-TrackerIndexingTree * tracker_indexing_tree_new (GFile *root);
+TrackerIndexingTree * tracker_indexing_tree_new (void);
+
+TrackerIndexingTree * tracker_indexing_tree_new_with_root (GFile *root);
void tracker_indexing_tree_add (TrackerIndexingTree *tree,
GFile *directory,
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index df3fa0b..4a8167d 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -885,7 +885,7 @@ fs_constructed (GObject *object)
}
/* Create indexing tree */
- priv->indexing_tree = tracker_indexing_tree_new (priv->root);
+ priv->indexing_tree = tracker_indexing_tree_new_with_root (priv->root);
}
static void
diff --git a/src/libtracker-miner/tracker-miner.vapi b/src/libtracker-miner/tracker-miner.vapi
index 8f504a6..0fed20b 100644
--- a/src/libtracker-miner/tracker-miner.vapi
+++ b/src/libtracker-miner/tracker-miner.vapi
@@ -46,7 +46,7 @@ namespace Tracker {
[CCode (cheader_filename = "libtracker-miner/tracker-miner.h", type_id =
"tracker_indexing_tree_get_type ()")]
public class IndexingTree : GLib.Object {
[CCode (has_construct_function = false)]
- public IndexingTree (GLib.File root);
+ public IndexingTree ();
public void add (GLib.File directory, Tracker.DirectoryFlags flags);
public void add_filter (Tracker.FilterType filter, string glob_string);
public void clear_filters (Tracker.FilterType type);
@@ -62,6 +62,8 @@ namespace Tracker {
public void remove (GLib.File directory);
public void set_default_policy (Tracker.FilterType filter, Tracker.FilterPolicy policy);
public void set_filter_hidden (bool filter_hidden);
+ [CCode (has_construct_function = false)]
+ public IndexingTree.with_root (GLib.File root);
public bool filter_hidden { get; set; }
[NoAccessorMethod]
public GLib.File root { owned get; construct; }
diff --git a/tests/libtracker-miner/tracker-file-notifier-test.c
b/tests/libtracker-miner/tracker-file-notifier-test.c
index 9e48090..20825f5 100644
--- a/tests/libtracker-miner/tracker-file-notifier-test.c
+++ b/tests/libtracker-miner/tracker-file-notifier-test.c
@@ -274,7 +274,7 @@ test_common_context_setup (TestCommonContext *fixture,
CREATE_FOLDER (fixture, "non-recursive");
CREATE_FOLDER (fixture, "non-indexed");
- fixture->indexing_tree = tracker_indexing_tree_new (NULL);
+ fixture->indexing_tree = tracker_indexing_tree_new ();
tracker_indexing_tree_set_filter_hidden (fixture->indexing_tree, TRUE);
fixture->main_loop = g_main_loop_new (NULL, FALSE);
diff --git a/tests/libtracker-miner/tracker-indexing-tree-test.c
b/tests/libtracker-miner/tracker-indexing-tree-test.c
index 3e70630..78b874c 100644
--- a/tests/libtracker-miner/tracker-indexing-tree-test.c
+++ b/tests/libtracker-miner/tracker-indexing-tree-test.c
@@ -96,7 +96,7 @@ test_common_context_setup (TestCommonContext *fixture,
for (i = 0; i < TEST_DIRECTORY_LAST; i++)
fixture->test_dir[i] = g_file_new_for_path (test_directories_subpaths[i]);
- fixture->tree = tracker_indexing_tree_new (NULL);
+ fixture->tree = tracker_indexing_tree_new ();
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]