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



commit 5bf3ade9776a3924aed83fdfba78e2bc6d1a084d
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-common/tracker-locale-gconfdbus.c |    2 +-
 src/libtracker-data/tracker-data-manager.c       |   11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-common/tracker-locale-gconfdbus.c b/src/libtracker-common/tracker-locale-gconfdbus.c
index 7bc76a2..f5c70a8 100644
--- a/src/libtracker-common/tracker-locale-gconfdbus.c
+++ b/src/libtracker-common/tracker-locale-gconfdbus.c
@@ -30,7 +30,7 @@
 
 /* This helps with testing, change all the names in gconf-dbus and then you
  * can run it in parallel with an upstream gconf-d of the GNOME platform */
-#define GCONF_DBUS_NAME "GConf"
+#define GCONF_DBUS_NAME "GConfDBus"
 
 #define GCONF_DBUS_SERVICE                    "org.gnome." GCONF_DBUS_NAME
 #define GCONF_DBUS_SERVER_INTERFACE           "org.gnome." GCONF_DBUS_NAME ".Server"
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]