[tracker/collation-gconf-locale: 7/15] libtracker-data: Make sure the new tracker-locale is used everywhere



commit 0ba1317d5aca8c27fe71a63a6c9923661b183306
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Thu Oct 28 12:53:23 2010 +0200

    libtracker-data: Make sure the new tracker-locale is used everywhere

 src/libtracker-data/tracker-collation.c  |   10 ++++++++--
 src/libtracker-data/tracker-db-manager.c |    5 ++++-
 2 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-data/tracker-collation.c b/src/libtracker-data/tracker-collation.c
index ff20d80..e0ff2d0 100644
--- a/src/libtracker-data/tracker-collation.c
+++ b/src/libtracker-data/tracker-collation.c
@@ -49,9 +49,12 @@
 gpointer
 tracker_collation_init (void)
 {
-	const gchar *locale = setlocale (LC_COLLATE, NULL);
+	gchar *locale;
 
+	/* Get locale! */
+	locale = tracker_locale_get (TRACKER_LOCALE_COLLATE);
 	g_debug ("[libunistring collation] Initializing collator for locale '%s'", locale);
+	g_free (locale);
 	/* Nothing to do */
 	return NULL;
 }
@@ -188,9 +191,12 @@ tracker_collation_utf8 (gpointer      collator,
 gpointer
 tracker_collation_init (void)
 {
-	const gchar *locale = setlocale (LC_COLLATE, NULL);
+	gchar *locale;
 
+	/* Get locale! */
+	locale = tracker_locale_get (TRACKER_LOCALE_COLLATE);
 	g_debug ("[GLib collation] Initializing collator for locale '%s'", locale);
+	g_free (locale);
 	/* Nothing to do */
 	return NULL;
 }
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index 68dccdc..227ae4b 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -642,6 +642,7 @@ static void
 db_recreate_all (void)
 {
 	guint i;
+	gchar *locale;
 
 	/* We call an internal version of this function here
 	 * because at the time 'initialized' = FALSE and that
@@ -667,8 +668,10 @@ db_recreate_all (void)
 		dbs[i].iface = NULL;
 	}
 
+	locale = tracker_locale_get (TRACKER_LOCALE_COLLATE);
 	/* Initialize locale file */
-	db_set_locale (setlocale (LC_COLLATE, NULL));
+	db_set_locale (locale);
+	g_free (locale);
 }
 
 void



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