[tracker/wip/carlosg/tracker-3.0-api-breaks: 41/79] examples: Change async connection example to use local connection
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/tracker-3.0-api-breaks: 41/79] examples: Change async connection example to use local connection
- Date: Mon, 27 Jan 2020 12:20:43 +0000 (UTC)
commit f71cac8a262b4be9634d7ed56a26a88a73c3708a
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Dec 30 14:05:14 2019 +0100
examples: Change async connection example to use local connection
Just for the sake of keeping everything async.
examples/libtracker-sparql/async-connection.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/examples/libtracker-sparql/async-connection.c b/examples/libtracker-sparql/async-connection.c
index 9f0b103cc..6d44cf607 100644
--- a/examples/libtracker-sparql/async-connection.c
+++ b/examples/libtracker-sparql/async-connection.c
@@ -116,7 +116,7 @@ connection_cb (GObject *object,
MyData *md = user_data;
GError *error = NULL;
- md->connection = tracker_sparql_connection_get_finish (res, &error);
+ md->connection = tracker_sparql_connection_new_finish (res, &error);
g_print ("Async connection took: %.6f\n", g_timer_elapsed (md->timer, NULL));
g_timer_start (md->timer);
@@ -137,14 +137,25 @@ connection_cb (GObject *object,
gint
main (gint argc, gchar *argv[])
{
+ GFile *store;
MyData *md;
+ if (argc > 1) {
+ store = g_file_new_for_commandline_arg (argv[1]);
+ } else {
+ g_print ("Usage: <command> <store-path>\n");
+ exit (1);
+ }
+
md = g_new0 (MyData, 1);
md->loop = g_main_loop_new (NULL, FALSE);
md->timer = g_timer_new ();
md->cancellable = g_cancellable_new ();
- tracker_sparql_connection_get_async (md->cancellable,
+ tracker_sparql_connection_new_async (0,
+ store,
+ NULL,
+ md->cancellable,
connection_cb,
md);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]