[tracker] libtracker-miner: Add TrackerIndexingTree::child-updated signal
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-miner: Add TrackerIndexingTree::child-updated signal
- Date: Sat, 28 May 2016 22:15:44 +0000 (UTC)
commit 3ab00e63d987d394cca019d10702f221b0a41848
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed May 25 00:29:31 2016 +0200
libtracker-miner: Add TrackerIndexingTree::child-updated signal
So we can notify on something else than indexing roots. May be
used for the IndexFile request.
src/libtracker-miner/tracker-indexing-tree.c | 34 ++++++++++++++++++++++----
src/libtracker-miner/tracker-indexing-tree.h | 6 +++-
2 files changed, 33 insertions(+), 7 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-indexing-tree.c b/src/libtracker-miner/tracker-indexing-tree.c
index 98fd48e..c95d3e8 100644
--- a/src/libtracker-miner/tracker-indexing-tree.c
+++ b/src/libtracker-miner/tracker-indexing-tree.c
@@ -79,6 +79,7 @@ enum {
DIRECTORY_ADDED,
DIRECTORY_REMOVED,
DIRECTORY_UPDATED,
+ CHILD_UPDATED,
LAST_SIGNAL
};
@@ -315,11 +316,10 @@ tracker_indexing_tree_class_init (TrackerIndexingTreeClass *klass)
* @indexing_tree: a #TrackerIndexingTree
* @directory: a #GFile
*
- * the ::directory-updated signal is emitted when @directory
- * that was previously added has had its indexing flags
- * updated due to another directory that is a parent of
- * @directory changing. This tends to happen uppon
- * tracker_indexing_tree_add() API calls.
+ * The ::directory-updated signal is emitted on a root
+ * when either its indexing flags change (e.g. due to consecutive
+ * calls to tracker_indexing_tree_add()), or anytime an update is
+ * requested through tracker_indexing_tree_notify_update().
*
* Since: 0.14.0
**/
@@ -333,6 +333,30 @@ tracker_indexing_tree_class_init (TrackerIndexingTreeClass *klass)
NULL,
G_TYPE_NONE, 1, G_TYPE_FILE);
+ /**
+ * TrackerIndexingTree::child-updated:
+ * @indexing_tree: a #TrackerIndexingTree
+ * @root: the root of this child
+ * @child: the updated child
+ *
+ * The ::child-updated signal may be emitted to notify
+ * about possible changes on children of a root.
+ *
+ * #TrackerIndexingTree does not emit those by itself,
+ * those may be triggered through tracker_indexing_tree_notify_update().
+ *
+ * Since: 1.10
+ **/
+ signals[CHILD_UPDATED] =
+ g_signal_new ("child-updated",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (TrackerIndexingTreeClass,
+ child_updated),
+ NULL, NULL,
+ NULL,
+ G_TYPE_NONE, 2, G_TYPE_FILE, G_TYPE_FILE);
+
g_type_class_add_private (object_class,
sizeof (TrackerIndexingTreePrivate));
}
diff --git a/src/libtracker-miner/tracker-indexing-tree.h b/src/libtracker-miner/tracker-indexing-tree.h
index a569167..ab4dc24 100644
--- a/src/libtracker-miner/tracker-indexing-tree.h
+++ b/src/libtracker-miner/tracker-indexing-tree.h
@@ -70,9 +70,11 @@ typedef struct {
GFile *directory);
void (* directory_updated) (TrackerIndexingTree *indexing_tree,
GFile *directory);
-
+ void (* child_updated) (TrackerIndexingTree *indexing_tree,
+ GFile *root,
+ GFile *child);
/* <Private> */
- gpointer padding[10];
+ gpointer padding[9];
} TrackerIndexingTreeClass;
GType tracker_indexing_tree_get_type (void) G_GNUC_CONST;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]