[tracker/collation-gconf-locale: 14/28] libtracker-data: Reset collator also before starting the stmt processing



commit 4a266e57097d72f962b4cbf1634b4a30bc7941eb
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Thu Oct 28 18:08:34 2010 +0200

    libtracker-data: Reset collator also before starting the stmt processing

 src/libtracker-data/tracker-db-interface-sqlite.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-interface-sqlite.c b/src/libtracker-data/tracker-db-interface-sqlite.c
index 3673663..21abb21 100644
--- a/src/libtracker-data/tracker-db-interface-sqlite.c
+++ b/src/libtracker-data/tracker-db-interface-sqlite.c
@@ -88,6 +88,7 @@ struct TrackerDBCursor {
 	TrackerSparqlCursor parent_instance;
 	sqlite3_stmt *stmt;
 	TrackerDBStatement *ref_stmt;
+	gboolean started;
 	gboolean finished;
 	TrackerPropertyType *types;
 	gint n_types;
@@ -1091,6 +1092,13 @@ create_result_set_from_stmt (TrackerDBInterface  *interface,
 	columns = sqlite3_column_count (stmt);
 	result = SQLITE_OK;
 
+	/* Statement is going to start, check if we got a request to reset the
+	 * collator, and if so, do it. */
+	if (interface->collator_reset_requested) {
+		tracker_db_interface_sqlite_reset_collator (interface);
+		interface->collator_reset_requested = FALSE;
+	}
+
 	while (result == SQLITE_OK  ||
 	       result == SQLITE_ROW) {
 
@@ -1525,6 +1533,17 @@ db_cursor_iter_next (TrackerDBCursor *cursor,
 	TrackerDBStatement *stmt = cursor->ref_stmt;
 	TrackerDBInterface *iface = stmt->db_interface;
 
+	if (!cursor->started) {
+		/* Statement is going to start, check if we got a request to reset the
+		 * collator, and if so, do it. */
+		if (iface->collator_reset_requested) {
+			tracker_db_interface_sqlite_reset_collator (iface);
+			iface->collator_reset_requested = FALSE;
+		}
+
+		cursor->started = TRUE;
+	}
+
 	if (!cursor->finished) {
 		guint result;
 



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