[tracker] libtracker-data: Support NULL as error parameter for update functions
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Support NULL as error parameter for update functions
- Date: Wed, 25 Nov 2009 15:21:21 +0000 (UTC)
commit ef7190ea163593bd386bc8f18d5dd6f40840e2a6
Author: Jürg Billeter <j bitron ch>
Date: Wed Nov 25 10:07:21 2009 +0100
libtracker-data: Support NULL as error parameter for update functions
src/libtracker-data/tracker-data-update.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 01cb9ea..9ef0132 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -1992,6 +1992,7 @@ void
tracker_data_update_sparql (const gchar *update,
GError **error)
{
+ GError *actual_error = NULL;
TrackerDBInterface *iface;
TrackerSparqlQuery *sparql_query;
@@ -2003,9 +2004,9 @@ tracker_data_update_sparql (const gchar *update,
tracker_db_interface_execute_query (iface, NULL, "SAVEPOINT sparql");
- tracker_sparql_query_execute_update (sparql_query, FALSE, error);
+ tracker_sparql_query_execute_update (sparql_query, FALSE, &actual_error);
- if (*error) {
+ if (actual_error) {
tracker_data_update_buffer_clear ();
tracker_db_interface_execute_query (iface, NULL, "ROLLBACK TO sparql");
@@ -2017,6 +2018,9 @@ tracker_data_update_sparql (const gchar *update,
delegate->callback (delegate->user_data);
}
}
+
+ g_propagate_error (error, actual_error);
+ return;
}
tracker_db_interface_execute_query (iface, NULL, "RELEASE sparql");
@@ -2029,6 +2033,7 @@ GPtrArray *
tracker_data_update_sparql_blank (const gchar *update,
GError **error)
{
+ GError *actual_error = NULL;
TrackerDBInterface *iface;
TrackerSparqlQuery *sparql_query;
GPtrArray *blank_nodes;
@@ -2041,9 +2046,9 @@ tracker_data_update_sparql_blank (const gchar *update,
tracker_db_interface_execute_query (iface, NULL, "SAVEPOINT sparql");
- blank_nodes = tracker_sparql_query_execute_update (sparql_query, TRUE, error);
+ blank_nodes = tracker_sparql_query_execute_update (sparql_query, TRUE, &actual_error);
- if (*error) {
+ if (actual_error) {
tracker_data_update_buffer_clear ();
tracker_db_interface_execute_query (iface, NULL, "ROLLBACK TO sparql");
@@ -2055,6 +2060,9 @@ tracker_data_update_sparql_blank (const gchar *update,
delegate->callback (delegate->user_data);
}
}
+
+ g_propagate_error (error, actual_error);
+ return NULL;
}
tracker_db_interface_execute_query (iface, NULL, "RELEASE sparql");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]