[tracker] libtracker-data: Handle error case when resetting collator
- From: JÃrg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Handle error case when resetting collator
- Date: Mon, 5 Dec 2011 15:38:38 +0000 (UTC)
commit bf49be791f8cf53cb26da256c896413238542b3c
Author: JÃrg Billeter <j bitron ch>
Date: Mon Dec 5 16:21:08 2011 +0100
libtracker-data: Handle error case when resetting collator
Fixes NB#293766.
src/libtracker-data/tracker-db-interface-sqlite.c | 21 ++++++---------------
1 files changed, 6 insertions(+), 15 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-interface-sqlite.c b/src/libtracker-data/tracker-db-interface-sqlite.c
index 7e8779d..5c2b2a4 100644
--- a/src/libtracker-data/tracker-db-interface-sqlite.c
+++ b/src/libtracker-data/tracker-db-interface-sqlite.c
@@ -72,7 +72,6 @@ struct TrackerDBInterface {
GSList *function_data;
/* Collation and locale change */
- gpointer collator;
gpointer locale_notification_id;
gint collator_reset_requested;
@@ -1041,17 +1040,13 @@ tracker_db_interface_sqlite_reset_collator (TrackerDBInterface *db_interface)
{
g_debug ("Resetting collator in db interface %p", db_interface);
- if (db_interface->collator) {
- tracker_collation_shutdown (db_interface->collator);
- }
-
- db_interface->collator = tracker_collation_init ();
/* This will overwrite any other collation set before, if any */
- if (sqlite3_create_collation (db_interface->db,
- TRACKER_COLLATION_NAME,
- SQLITE_UTF8,
- db_interface->collator,
- tracker_collation_utf8) != SQLITE_OK)
+ if (sqlite3_create_collation_v2 (db_interface->db,
+ TRACKER_COLLATION_NAME,
+ SQLITE_UTF8,
+ tracker_collation_init (),
+ tracker_collation_utf8,
+ tracker_collation_shutdown) != SQLITE_OK)
{
g_critical ("Couldn't set collation function: %s",
sqlite3_errmsg (db_interface->db));
@@ -1095,10 +1090,6 @@ tracker_db_interface_sqlite_finalize (GObject *object)
tracker_locale_notify_remove (db_interface->locale_notification_id);
}
- if (db_interface->collator) {
- tracker_collation_shutdown (db_interface->collator);
- }
-
G_OBJECT_CLASS (tracker_db_interface_parent_class)->finalize (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]