[tracker/direct-for-master] libtracker-data: Do not cope with ontology changes in read-only mode



commit d4d30d4ab9f414e508bbe8fa66a3f3950bef6c19
Author: Philip Van Hoof <philip codeminded be>
Date:   Thu Jul 8 12:19:33 2010 +0200

    libtracker-data: Do not cope with ontology changes in read-only mode

 src/libtracker-data/tracker-data-manager.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index a396c26..232e55b 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -2684,9 +2684,12 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 	GList *sorted = NULL, *l;
 	const gchar *env_path;
 	gint max_id = 0;
+	gboolean read_only;
 
 	tracker_data_update_init ();
 
+	read_only = (flags & TRACKER_DB_MANAGER_READONLY) ? TRUE : FALSE;
+
 	/* First set defaults for return values */
 	if (first_time) {
 		*first_time = FALSE;
@@ -2773,7 +2776,7 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 		g_hash_table_unref (properties);
 		g_hash_table_unref (id_uri_map);
 
-	} else if (is_first_time_index) {
+	} else if (is_first_time_index && !read_only) {
 		sorted = get_ontologies (test_schemas != NULL, ontologies_dir);
 
 		/* Truncate journal as it does not even contain a single valid transaction
@@ -2852,7 +2855,7 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 		tracker_db_interface_sqlite_fts_init (iface, FALSE);
 	}
 
-	if (check_ontology) {
+	if (check_ontology && !read_only) {
 		GList *to_reload = NULL;
 		GList *ontos = NULL;
 		guint p;



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