[tracker/cursor: 2/15] libtracker-data: Use Cursor instead of ResultSet in data-update
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/cursor: 2/15] libtracker-data: Use Cursor instead of ResultSet in data-update
- Date: Wed, 19 Jan 2011 10:20:09 +0000 (UTC)
commit 93b0ea4b3aeebff07399ad4588141caca04034bf
Author: Jürg Billeter <j bitron ch>
Date: Tue Jan 18 15:13:29 2011 +0100
libtracker-data: Use Cursor instead of ResultSet in data-update
src/libtracker-data/tracker-data-update.c | 29 ++++++++++++++---------------
1 files changed, 14 insertions(+), 15 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 372de66..855b05f 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -1732,7 +1732,7 @@ cache_delete_resource_type (TrackerClass *class,
{
TrackerDBInterface *iface;
TrackerDBStatement *stmt;
- TrackerDBResultSet *result_set = NULL;
+ TrackerDBCursor *cursor = NULL;
TrackerProperty **properties, *prop;
gboolean found, direct_delete;
gint i;
@@ -1764,27 +1764,26 @@ cache_delete_resource_type (TrackerClass *class,
if (stmt) {
tracker_db_statement_bind_int (stmt, 0, resource_buffer->id);
tracker_db_statement_bind_text (stmt, 1, tracker_class_get_uri (class));
- result_set = tracker_db_statement_execute (stmt, &error);
+ cursor = tracker_db_statement_start_cursor (stmt, &error);
g_object_unref (stmt);
}
- if (error) {
- g_warning ("%s", error->message);
- g_error_free (error);
- error = NULL;
- }
-
- if (result_set) {
- do {
- gchar *class_uri;
+ if (cursor) {
+ while (tracker_db_cursor_iter_next (cursor, NULL, &error)) {
+ const gchar *class_uri;
- tracker_db_result_set_get (result_set, 0, &class_uri, -1);
+ class_uri = tracker_db_cursor_get_string (cursor, 0, NULL);
cache_delete_resource_type (tracker_ontologies_get_class_by_uri (class_uri),
graph, graph_id);
- g_free (class_uri);
- } while (tracker_db_result_set_iter_next (result_set));
+ }
+
+ g_object_unref (cursor);
+ }
- g_object_unref (result_set);
+ if (error) {
+ g_warning ("%s", error->message);
+ g_error_free (error);
+ error = NULL;
}
/* bypass buffer if possible
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]