[tracker/gconf-dbus: 7/8] libtracker-common, -data: Don't reinit locale at each locale change



commit f69ffdbac318cdbdaad323dc7752255d5b43c0c2
Author: Philip Van Hoof <philip codeminded be>
Date:   Mon Apr 4 12:56:05 2011 +0200

    libtracker-common, -data: Don't reinit locale at each locale change

 src/libtracker-data/tracker-data-manager.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index ae5a5b0..6642df4 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -75,6 +75,7 @@
 static gchar    *ontologies_dir;
 static gboolean  initialized;
 static gboolean  in_journal_replay;
+static gboolean  reloading = FALSE;
 
 typedef struct {
 	const gchar *from;
@@ -3383,6 +3384,7 @@ tracker_data_manager_reload (TrackerBusyCallback   busy_callback,
 	g_message ("Reloading data manager...");
 	/* Shutdown data manager... */
 	flags = tracker_db_manager_get_flags (&select_cache_size, &update_cache_size);
+	reloading = TRUE;
 	tracker_data_manager_shutdown ();
 
 	g_message ("  Data manager shut down, now initializing again...");
@@ -3398,6 +3400,7 @@ tracker_data_manager_reload (TrackerBusyCallback   busy_callback,
 	                                    busy_user_data,
 	                                    busy_operation,
 	                                    &internal_error);
+	reloading = FALSE;
 
 	if (internal_error) {
 		g_propagate_error (error, internal_error);
@@ -3480,7 +3483,9 @@ tracker_data_manager_init (TrackerDBManagerFlags   flags,
 	/* Make sure we initialize all other modules we depend on */
 	tracker_ontologies_init ();
 
-	tracker_locale_init ();
+	if (!reloading) {
+		tracker_locale_init ();
+	}
 
 	read_journal = FALSE;
 
@@ -4136,7 +4141,9 @@ tracker_data_manager_shutdown (void)
 	tracker_db_journal_shutdown ();
 	tracker_db_manager_shutdown ();
 	tracker_ontologies_shutdown ();
-	tracker_locale_shutdown ();
+	if (!reloading) {
+		tracker_locale_shutdown ();
+	}
 	tracker_data_update_shutdown ();
 
 	initialized = FALSE;



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