[tracker/wip/carlosg/last-api-changes: 2/3] libtracker-sparql: Drop priority argument from async functions



commit 72b936f79df0fb2ece6bb1152aa0df0b381ef451
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Jun 18 20:37:23 2020 +0200

    libtracker-sparql: Drop priority argument from async functions
    
    Fixes: https://gitlab.gnome.org/GNOME/tracker/-/issues/218

 src/libtracker-bus/tracker-bus.vala                         | 10 +++++-----
 src/libtracker-direct/tracker-direct.c                      |  6 ------
 src/libtracker-sparql/libtracker-sparql-intermediate-c.vapi |  6 +++---
 src/libtracker-sparql/tracker-connection.c                  |  9 ---------
 src/libtracker-sparql/tracker-connection.h                  |  3 ---
 src/libtracker-sparql/tracker-endpoint-dbus.c               |  2 --
 src/libtracker-sparql/tracker-private.h                     |  3 ---
 tests/functional-tests/concurrent-query.py                  |  2 +-
 tests/libtracker-sparql/tracker-fd-test.c                   |  4 ----
 9 files changed, 9 insertions(+), 36 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-bus.vala b/src/libtracker-bus/tracker-bus.vala
index e01408f50..fb77c04e8 100644
--- a/src/libtracker-bus/tracker-bus.vala
+++ b/src/libtracker-bus/tracker-bus.vala
@@ -142,7 +142,7 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
                var loop = new MainLoop (context, false);
                context.push_thread_default ();
                AsyncResult async_res = null;
-               update_async.begin (sparql, GLib.Priority.DEFAULT, cancellable, (o, res) => {
+               update_async.begin (sparql, cancellable, (o, res) => {
                        async_res = res;
                        loop.quit ();
                });
@@ -151,7 +151,7 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
                update_async.end (async_res);
        }
 
-       public async override void update_async (string sparql, int priority = GLib.Priority.DEFAULT, 
Cancellable? cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, DBusError {
+       public async override void update_async (string sparql, Cancellable? cancellable = null) throws 
Sparql.Error, GLib.Error, GLib.IOError, DBusError {
                UnixInputStream input;
                UnixOutputStream output;
                pipe (out input, out output);
@@ -183,7 +183,7 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
                handle_error_reply (reply);
        }
 
-       public async override bool update_array_async (string[] sparql, int priority = GLib.Priority.DEFAULT, 
Cancellable? cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, DBusError {
+       public async override bool update_array_async (string[] sparql, Cancellable? cancellable = null) 
throws Sparql.Error, GLib.Error, GLib.IOError, DBusError {
                UnixInputStream input;
                UnixOutputStream output;
                pipe (out input, out output);
@@ -226,7 +226,7 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
                var loop = new MainLoop (context, false);
                context.push_thread_default ();
                AsyncResult async_res = null;
-               update_blank_async.begin (sparql, GLib.Priority.DEFAULT, cancellable, (o, res) => {
+               update_blank_async.begin (sparql, cancellable, (o, res) => {
                        async_res = res;
                        loop.quit ();
                });
@@ -235,7 +235,7 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
                return update_blank_async.end (async_res);
        }
 
-       public async override GLib.Variant? update_blank_async (string sparql, int priority = 
GLib.Priority.DEFAULT, Cancellable? cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, 
DBusError {
+       public async override GLib.Variant? update_blank_async (string sparql, Cancellable? cancellable = 
null) throws Sparql.Error, GLib.Error, GLib.IOError, DBusError {
                UnixInputStream input;
                UnixOutputStream output;
                pipe (out input, out output);
diff --git a/src/libtracker-direct/tracker-direct.c b/src/libtracker-direct/tracker-direct.c
index 38e48323c..ebae03d95 100644
--- a/src/libtracker-direct/tracker-direct.c
+++ b/src/libtracker-direct/tracker-direct.c
@@ -730,7 +730,6 @@ tracker_direct_connection_update (TrackerSparqlConnection  *self,
 static void
 tracker_direct_connection_update_async (TrackerSparqlConnection *self,
                                         const gchar             *sparql,
-                                        gint                     priority,
                                         GCancellable            *cancellable,
                                         GAsyncReadyCallback      callback,
                                         gpointer                 user_data)
@@ -743,7 +742,6 @@ tracker_direct_connection_update_async (TrackerSparqlConnection *self,
        priv = tracker_direct_connection_get_instance_private (conn);
 
        task = g_task_new (self, cancellable, callback, user_data);
-       g_task_set_priority (task, priority);
        g_task_set_task_data (task,
                              task_data_query_new (TASK_TYPE_UPDATE, sparql),
                              (GDestroyNotify) task_data_free);
@@ -763,7 +761,6 @@ static void
 tracker_direct_connection_update_array_async (TrackerSparqlConnection  *self,
                                               gchar                   **updates,
                                               gint                      n_updates,
-                                              gint                      priority,
                                               GCancellable             *cancellable,
                                               GAsyncReadyCallback       callback,
                                               gpointer                  user_data)
@@ -788,7 +785,6 @@ tracker_direct_connection_update_array_async (TrackerSparqlConnection  *self,
        task_data->query = concatenated;
 
        task = g_task_new (self, cancellable, callback, user_data);
-       g_task_set_priority (task, priority);
        g_task_set_task_data (task, task_data,
                              (GDestroyNotify) task_data_free);
 
@@ -828,7 +824,6 @@ tracker_direct_connection_update_blank (TrackerSparqlConnection  *self,
 static void
 tracker_direct_connection_update_blank_async (TrackerSparqlConnection *self,
                                               const gchar             *sparql,
-                                              gint                     priority,
                                               GCancellable            *cancellable,
                                               GAsyncReadyCallback      callback,
                                               gpointer                 user_data)
@@ -841,7 +836,6 @@ tracker_direct_connection_update_blank_async (TrackerSparqlConnection *self,
        priv = tracker_direct_connection_get_instance_private (conn);
 
        task = g_task_new (self, cancellable, callback, user_data);
-       g_task_set_priority (task, priority);
        g_task_set_task_data (task,
                              task_data_query_new (TASK_TYPE_UPDATE_BLANK, sparql),
                              (GDestroyNotify) task_data_free);
diff --git a/src/libtracker-sparql/libtracker-sparql-intermediate-c.vapi 
b/src/libtracker-sparql/libtracker-sparql-intermediate-c.vapi
index aca920da9..d3bdbae4e 100644
--- a/src/libtracker-sparql/libtracker-sparql-intermediate-c.vapi
+++ b/src/libtracker-sparql/libtracker-sparql-intermediate-c.vapi
@@ -73,10 +73,10 @@ namespace Tracker {
                public async abstract Cursor query_async (string sparql, GLib.Cancellable? cancellable = 
null) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
 
                public virtual void update (string sparql, GLib.Cancellable? cancellable = null) throws 
Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
-               public async virtual void update_async (string sparql, int priority = GLib.Priority.DEFAULT, 
GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
-               public async virtual bool update_array_async (string[] sparql, int priority = 
GLib.Priority.DEFAULT, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, 
GLib.DBusError;
+               public async virtual void update_async (string sparql, GLib.Cancellable? cancellable = null) 
throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
+               public async virtual bool update_array_async (string[] sparql, GLib.Cancellable? cancellable 
= null) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
                public virtual GLib.Variant? update_blank (string sparql, GLib.Cancellable? cancellable = 
null) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
-               public async virtual GLib.Variant? update_blank_async (string sparql, int priority = 
GLib.Priority.DEFAULT, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, 
GLib.DBusError;
+               public async virtual GLib.Variant? update_blank_async (string sparql, GLib.Cancellable? 
cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
 
                public virtual NamespaceManager? get_namespace_manager ();
 
diff --git a/src/libtracker-sparql/tracker-connection.c b/src/libtracker-sparql/tracker-connection.c
index a17bd5851..6fbb2cc1f 100644
--- a/src/libtracker-sparql/tracker-connection.c
+++ b/src/libtracker-sparql/tracker-connection.c
@@ -276,7 +276,6 @@ tracker_sparql_connection_update (TrackerSparqlConnection  *connection,
  * tracker_sparql_connection_update_async:
  * @connection: a #TrackerSparqlConnection
  * @sparql: string containing the SPARQL update query
- * @priority: the priority for the asynchronous operation
  * @cancellable: a #GCancellable used to cancel the operation
  * @callback: user-defined #GAsyncReadyCallback to be called when
  *            asynchronous operation is finished.
@@ -287,7 +286,6 @@ tracker_sparql_connection_update (TrackerSparqlConnection  *connection,
 void
 tracker_sparql_connection_update_async (TrackerSparqlConnection *connection,
                                         const gchar             *sparql,
-                                        gint                     priority,
                                         GCancellable            *cancellable,
                                         GAsyncReadyCallback      callback,
                                         gpointer                 user_data)
@@ -298,7 +296,6 @@ tracker_sparql_connection_update_async (TrackerSparqlConnection *connection,
 
        TRACKER_SPARQL_CONNECTION_GET_CLASS (connection)->update_async (connection,
                                                                        sparql,
-                                                                       priority,
                                                                        cancellable,
                                                                        callback,
                                                                        user_data);
@@ -331,7 +328,6 @@ tracker_sparql_connection_update_finish (TrackerSparqlConnection  *connection,
  * @connection: a #TrackerSparqlConnection
  * @sparql: an array of strings containing the SPARQL update queries
  * @sparql_length: the amount of strings you pass as @sparql
- * @priority: the priority for the asynchronous operation
  * @cancellable: a #GCancellable used to cancel the operation
  * @callback: user-defined #GAsyncReadyCallback to be called when
  *            asynchronous operation is finished.
@@ -345,7 +341,6 @@ void
 tracker_sparql_connection_update_array_async (TrackerSparqlConnection  *connection,
                                               gchar                   **sparql,
                                               gint                      sparql_length,
-                                              gint                      priority,
                                               GCancellable             *cancellable,
                                               GAsyncReadyCallback       callback,
                                               gpointer                  user_data)
@@ -357,7 +352,6 @@ tracker_sparql_connection_update_array_async (TrackerSparqlConnection  *connecti
        TRACKER_SPARQL_CONNECTION_GET_CLASS (connection)->update_array_async (connection,
                                                                              sparql,
                                                                              sparql_length,
-                                                                             priority,
                                                                              cancellable,
                                                                              callback,
                                                                              user_data);
@@ -457,7 +451,6 @@ tracker_sparql_connection_update_blank (TrackerSparqlConnection  *connection,
  * tracker_sparql_connection_update_blank_async:
  * @connection: a #TrackerSparqlConnection
  * @sparql: string containing the SPARQL update query
- * @priority: the priority for the asynchronous operation
  * @cancellable: a #GCancellable used to cancel the operation
  * @callback: user-defined #GAsyncReadyCallback to be called when
  *            asynchronous operation is finished.
@@ -468,7 +461,6 @@ tracker_sparql_connection_update_blank (TrackerSparqlConnection  *connection,
 void
 tracker_sparql_connection_update_blank_async (TrackerSparqlConnection *connection,
                                               const gchar             *sparql,
-                                              gint                     priority,
                                               GCancellable            *cancellable,
                                               GAsyncReadyCallback      callback,
                                               gpointer                 user_data)
@@ -479,7 +471,6 @@ tracker_sparql_connection_update_blank_async (TrackerSparqlConnection *connectio
 
        TRACKER_SPARQL_CONNECTION_GET_CLASS (connection)->update_blank_async (connection,
                                                                              sparql,
-                                                                             priority,
                                                                              cancellable,
                                                                              callback,
                                                                              user_data);
diff --git a/src/libtracker-sparql/tracker-connection.h b/src/libtracker-sparql/tracker-connection.h
index 553220600..57699a953 100644
--- a/src/libtracker-sparql/tracker-connection.h
+++ b/src/libtracker-sparql/tracker-connection.h
@@ -169,7 +169,6 @@ void tracker_sparql_connection_update (TrackerSparqlConnection  *connection,
 TRACKER_AVAILABLE_IN_ALL
 void tracker_sparql_connection_update_async (TrackerSparqlConnection *connection,
                                              const gchar             *sparql,
-                                             gint                     priority,
                                              GCancellable            *cancellable,
                                              GAsyncReadyCallback      callback,
                                              gpointer                 user_data);
@@ -181,7 +180,6 @@ TRACKER_AVAILABLE_IN_ALL
 void tracker_sparql_connection_update_array_async (TrackerSparqlConnection  *connection,
                                                    gchar                   **sparql,
                                                    gint                      sparql_length,
-                                                   gint                      priority,
                                                    GCancellable             *cancellable,
                                                    GAsyncReadyCallback       callback,
                                                    gpointer                  user_data);
@@ -197,7 +195,6 @@ GVariant * tracker_sparql_connection_update_blank (TrackerSparqlConnection  *con
 TRACKER_AVAILABLE_IN_ALL
 void tracker_sparql_connection_update_blank_async (TrackerSparqlConnection *connection,
                                                    const gchar             *sparql,
-                                                   gint                     priority,
                                                    GCancellable            *cancellable,
                                                    GAsyncReadyCallback      callback,
                                                    gpointer                 user_data);
diff --git a/src/libtracker-sparql/tracker-endpoint-dbus.c b/src/libtracker-sparql/tracker-endpoint-dbus.c
index 3504a4fa6..b03836a9d 100644
--- a/src/libtracker-sparql/tracker-endpoint-dbus.c
+++ b/src/libtracker-sparql/tracker-endpoint-dbus.c
@@ -409,7 +409,6 @@ read_update_cb (GObject      *object,
                tracker_sparql_connection_update_array_async (conn,
                                                              (gchar **) request->queries->pdata,
                                                              request->queries->len,
-                                                             G_PRIORITY_DEFAULT,
                                                              request->endpoint->cancellable,
                                                              update_cb,
                                                              request);
@@ -460,7 +459,6 @@ read_update_blank_cb (GObject      *object,
        conn = tracker_endpoint_get_sparql_connection (TRACKER_ENDPOINT (request->endpoint));
        tracker_sparql_connection_update_blank_async (conn,
                                                      g_ptr_array_index (request->queries, 0),
-                                                     G_PRIORITY_DEFAULT,
                                                      request->endpoint->cancellable,
                                                      update_blank_cb,
                                                      request);
diff --git a/src/libtracker-sparql/tracker-private.h b/src/libtracker-sparql/tracker-private.h
index 54e86fbea..676d328f9 100644
--- a/src/libtracker-sparql/tracker-private.h
+++ b/src/libtracker-sparql/tracker-private.h
@@ -46,7 +46,6 @@ struct _TrackerSparqlConnectionClass
                          GError                  **error);
         void (* update_async) (TrackerSparqlConnection *connection,
                                const gchar             *sparql,
-                               gint                     priority,
                                GCancellable            *cancellable,
                                GAsyncReadyCallback      callback,
                                gpointer                 user_data);
@@ -56,7 +55,6 @@ struct _TrackerSparqlConnectionClass
         void (* update_array_async) (TrackerSparqlConnection  *connection,
                                      gchar                   **sparql,
                                      gint                      sparql_length,
-                                     gint                      priority,
                                      GCancellable             *cancellable,
                                      GAsyncReadyCallback       callback,
                                      gpointer                  user_data);
@@ -69,7 +67,6 @@ struct _TrackerSparqlConnectionClass
                                     GError                  **error);
         void (* update_blank_async) (TrackerSparqlConnection *connection,
                                      const gchar             *sparql,
-                                     gint                     priority,
                                      GCancellable            *cancellable,
                                      GAsyncReadyCallback      callback,
                                      gpointer                 user_data);
diff --git a/tests/functional-tests/concurrent-query.py b/tests/functional-tests/concurrent-query.py
index 9620756b4..1ef8d69bc 100644
--- a/tests/functional-tests/concurrent-query.py
+++ b/tests/functional-tests/concurrent-query.py
@@ -68,7 +68,7 @@ class ConcurrentQueryTests():
         UPDATE = "INSERT { <test-09:picture-%d> a nmm:Photo. }"
         for i in range(0, AMOUNT_OF_QUERIES):
             self.conn.query_async(QUERY, None, self.query_cb)
-            self.conn.update_async(UPDATE % (i), 0, None, self.update_cb)
+            self.conn.update_async(UPDATE % (i), None, self.update_cb)
 
         # Safeguard of 60 seconds. The last reply should quit the loop
         GLib.timeout_add_seconds(60, self.timeout_cb)
diff --git a/tests/libtracker-sparql/tracker-fd-test.c b/tests/libtracker-sparql/tracker-fd-test.c
index 941288ad6..7e801418e 100644
--- a/tests/libtracker-sparql/tracker-fd-test.c
+++ b/tests/libtracker-sparql/tracker-fd-test.c
@@ -365,7 +365,6 @@ test_tracker_sparql_update_array_async (DataFixture   *fixture,
        tracker_sparql_connection_update_array_async (connection,
                                                      (char**) queries,
                                                      6,
-                                                     0,
                                                      NULL,
                                                      async_update_array_callback,
                                                      data);
@@ -608,7 +607,6 @@ test_tracker_sparql_update_async (DataFixture  *fixture,
 
        tracker_sparql_connection_update_async (connection,
                                                query,
-                                               0,
                                                NULL,
                                                async_update_callback,
                                                data);
@@ -647,7 +645,6 @@ test_tracker_sparql_update_async_cancel (DataFixture  *fixture,
 
        tracker_sparql_connection_update_async (connection,
                                                query,
-                                               0,
                                                cancellable,
                                                cancel_update_cb,
                                                main_loop);
@@ -690,7 +687,6 @@ test_tracker_sparql_update_blank_async (DataFixture *fixture,
 
        tracker_sparql_connection_update_blank_async (connection,
                                                      query,
-                                                     0,
                                                      NULL,
                                                      async_update_blank_callback,
                                                      data);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]