[tracker/rss-enclosures] libtracker-miner: New tracker_miner_execute_sparql_sync() API method
- From: Roberto Guido <rguido src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/rss-enclosures] libtracker-miner: New tracker_miner_execute_sparql_sync() API method
- Date: Wed, 24 Nov 2010 00:58:08 +0000 (UTC)
commit 1b31c7cd9ffc74d6fde5cb4b3447873a1e33346e
Author: Aleksander Morgado <aleksander lanedo com>
Date: Thu Jul 15 12:01:11 2010 +0200
libtracker-miner: New tracker_miner_execute_sparql_sync() API method
.../libtracker-miner/libtracker-miner-sections.txt | 1 +
src/libtracker-miner/tracker-miner-object.c | 30 ++++++++++++++++++-
src/libtracker-miner/tracker-miner-object.h | 6 +++-
3 files changed, 34 insertions(+), 3 deletions(-)
---
diff --git a/docs/reference/libtracker-miner/libtracker-miner-sections.txt b/docs/reference/libtracker-miner/libtracker-miner-sections.txt
index e33626b..0f3c3d2 100644
--- a/docs/reference/libtracker-miner/libtracker-miner-sections.txt
+++ b/docs/reference/libtracker-miner/libtracker-miner-sections.txt
@@ -47,6 +47,7 @@ tracker_miner_execute_update
tracker_miner_execute_update_finish
tracker_miner_execute_sparql
tracker_miner_execute_sparql_finish
+tracker_miner_execute_sparql_sync
tracker_miner_execute_batch_update
tracker_miner_execute_batch_update_finish
tracker_miner_commit
diff --git a/src/libtracker-miner/tracker-miner-object.c b/src/libtracker-miner/tracker-miner-object.c
index 20f2ff9..96a8d94 100644
--- a/src/libtracker-miner/tracker-miner-object.c
+++ b/src/libtracker-miner/tracker-miner-object.c
@@ -845,9 +845,9 @@ tracker_miner_execute_sparql (TrackerMiner *miner,
* Finishes the async operation and returns the query results. If an error
* occured during the query, @error will be set.
*
- * Returns: a #GPtrArray with the sparql results which should not be freed.
+ * Returns: a #TrackerResultIterator with the sparql results which should not be freed.
**/
-TrackerResultIterator*
+TrackerResultIterator *
tracker_miner_execute_sparql_finish (TrackerMiner *miner,
GAsyncResult *result,
GError **error)
@@ -862,6 +862,32 @@ tracker_miner_execute_sparql_finish (TrackerMiner *miner,
}
/**
+ * tracker_miner_execute_sparql_sync:
+ * @miner: a #TrackerMiner
+ * @sparql: a SPARQL query
+ * @error: a #GError
+ *
+ * Executes the SPARQL query on tracker-store and blocks until reply arrives.
+ * If an error occured during the query, @error will be set.
+ * Returns: A #TrackerResultIterator pointing before the first result row. This
+ * iterator must be disposed when done using tracker_result_iterator_free().
+ *
+ * Since: 0.9
+ **/
+TrackerResultIterator *
+tracker_miner_execute_sparql_sync (TrackerMiner *miner,
+ const gchar *sparql,
+ GError **error)
+{
+ g_return_val_if_fail (TRACKER_IS_MINER (miner), NULL);
+ g_return_val_if_fail (sparql != NULL, NULL);
+
+ return tracker_resources_sparql_query_iterate (miner->private->client,
+ sparql,
+ error);
+}
+
+/**
* tracker_miner_execute_batch_update:
* @miner: a #TrackerMiner
* @sparql: a set of SPARQL updates
diff --git a/src/libtracker-miner/tracker-miner-object.h b/src/libtracker-miner/tracker-miner-object.h
index 0280daa..677936f 100644
--- a/src/libtracker-miner/tracker-miner-object.h
+++ b/src/libtracker-miner/tracker-miner-object.h
@@ -111,10 +111,14 @@ void tracker_miner_execute_sparql (TrackerMiner
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
-TrackerResultIterator*
+TrackerResultIterator *
tracker_miner_execute_sparql_finish (TrackerMiner *miner,
GAsyncResult *result,
GError **error);
+TrackerResultIterator *
+ tracker_miner_execute_sparql_sync (TrackerMiner *miner,
+ const gchar *sparql,
+ GError **error);
void tracker_miner_execute_batch_update (TrackerMiner *miner,
const gchar *sparql,
GCancellable *cancellable,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]