[tracker] libtracker-bus: Handle error properly in array_update_finish()
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-bus: Handle error properly in array_update_finish()
- Date: Thu, 21 Oct 2010 08:55:55 +0000 (UTC)
commit 2cfff47a99f0632448b55dfb9f7070b22d4faade
Author: Aleksander Morgado <aleksander lanedo com>
Date: Thu Oct 21 10:54:15 2010 +0200
libtracker-bus: Handle error properly in array_update_finish()
src/libtracker-bus/tracker-bus-fd-update.c | 14 ++++++++++----
src/libtracker-bus/tracker-bus-fd-update.h | 6 ++++--
src/libtracker-bus/tracker-bus-fd-update.vapi | 5 ++---
3 files changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-bus-fd-update.c b/src/libtracker-bus/tracker-bus-fd-update.c
index 1ea0f38..6de18a4 100644
--- a/src/libtracker-bus/tracker-bus-fd-update.c
+++ b/src/libtracker-bus/tracker-bus-fd-update.c
@@ -847,25 +847,31 @@ tracker_bus_fd_sparql_batch_update_finish (GAsyncResult *res,
}
GPtrArray *
-tracker_bus_fd_sparql_update_array_finish (GAsyncResult *res)
+tracker_bus_fd_sparql_update_array_finish (GAsyncResult *res,
+ GError **error)
{
gpointer p;
g_return_val_if_fail (res != NULL, NULL);
+ g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
+
p = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res));
- return g_ptr_array_ref (p);
+ return p ? g_ptr_array_ref (p) : NULL;
}
GPtrArray *
-tracker_bus_fd_sparql_batch_update_array_finish (GAsyncResult *res)
+tracker_bus_fd_sparql_batch_update_array_finish (GAsyncResult *res,
+ GError **error)
{
gpointer p;
g_return_val_if_fail (res != NULL, NULL);
+ g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
+
p = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res));
- return g_ptr_array_ref (p);
+ return p ? g_ptr_array_ref (p) : NULL;
}
diff --git a/src/libtracker-bus/tracker-bus-fd-update.h b/src/libtracker-bus/tracker-bus-fd-update.h
index 46fdd46..df580cd 100644
--- a/src/libtracker-bus/tracker-bus-fd-update.h
+++ b/src/libtracker-bus/tracker-bus-fd-update.h
@@ -66,7 +66,9 @@ GVariant * tracker_bus_fd_sparql_update_blank_finish (GAsyncResult
void tracker_bus_fd_sparql_batch_update_finish (GAsyncResult *res,
GError **error);
-GPtrArray* tracker_bus_fd_sparql_update_array_finish (GAsyncResult *res);
-GPtrArray* tracker_bus_fd_sparql_batch_update_array_finish (GAsyncResult *res);
+GPtrArray* tracker_bus_fd_sparql_update_array_finish (GAsyncResult *res,
+ GError **error);
+GPtrArray* tracker_bus_fd_sparql_batch_update_array_finish (GAsyncResult *res,
+ GError **error);
G_END_DECLS
diff --git a/src/libtracker-bus/tracker-bus-fd-update.vapi b/src/libtracker-bus/tracker-bus-fd-update.vapi
index e5f1dc2..5525e54 100644
--- a/src/libtracker-bus/tracker-bus-fd-update.vapi
+++ b/src/libtracker-bus/tracker-bus-fd-update.vapi
@@ -29,8 +29,7 @@ public extern async void tracker_bus_fd_sparql_update_async (DBus.Connection con
public extern async GLib.Variant tracker_bus_fd_sparql_update_blank_async (DBus.Connection connection, string query, GLib.Cancellable? cancellable = null) throws Tracker.Sparql.Error, DBus.Error, GLib.IOError;
[CCode (cheader_filename = "tracker-bus-fd-update.h")]
public extern async void tracker_bus_fd_sparql_batch_update_async (DBus.Connection connection, string query, GLib.Cancellable? cancellable = null) throws Tracker.Sparql.Error, DBus.Error, GLib.IOError;
-
[CCode (cheader_filename = "tracker-bus-fd-update.h")]
-public extern async GLib.PtrArray? tracker_bus_fd_sparql_update_array_async (DBus.Connection connection, string query[], GLib.Cancellable? cancellable = null);
+public extern async GLib.PtrArray? tracker_bus_fd_sparql_update_array_async (DBus.Connection connection, string query[], GLib.Cancellable? cancellable = null) throws Tracker.Sparql.Error, DBus.Error, GLib.IOError;
[CCode (cheader_filename = "tracker-bus-fd-update.h")]
-public extern async GLib.PtrArray? tracker_bus_fd_sparql_batch_update_array_async (DBus.Connection connection, string[] query, GLib.Cancellable? cancellable = null);
+public extern async GLib.PtrArray? tracker_bus_fd_sparql_batch_update_array_async (DBus.Connection connection, string[] query, GLib.Cancellable? cancellable = null) throws Tracker.Sparql.Error, DBus.Error, GLib.IOError;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]