[tracker/wip/carlosg/tracker-3.0-api-breaks: 44/95] examples: Change async connection example to use local connection



commit 12dde85bea6422c3e9a186eff40a7bb9016a975d
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]