[tracker/journal: 11/18] libtracker-data: Fix IDs used for new ontology resources on replay



commit 3e8325d248d9cbd118e712df79fa06f34c88e763
Author: Jürg Billeter <j bitron ch>
Date:   Tue Oct 12 10:40:05 2010 +0200

    libtracker-data: Fix IDs used for new ontology resources on replay

 src/libtracker-data/tracker-data-manager.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 6c90cc5..28c5e0e 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -1236,7 +1236,8 @@ get_ontology_from_path (const gchar *ontology_path)
 }
 
 static void
-load_ontology_ids_from_journal (GHashTable **uri_id_map_out)
+load_ontology_ids_from_journal (GHashTable **uri_id_map_out,
+                                gint        *max_id)
 {
 	GHashTable *uri_id_map;
 
@@ -1253,6 +1254,9 @@ load_ontology_ids_from_journal (GHashTable **uri_id_map_out)
 
 			tracker_db_journal_reader_get_resource (&id, &uri);
 			g_hash_table_insert (uri_id_map, g_strdup (uri), GINT_TO_POINTER (id));
+			if (id > *max_id) {
+				*max_id = id;
+			}
 		}
 	}
 
@@ -2808,7 +2812,7 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 		tracker_db_journal_reader_ontology_init (NULL);
 
 		/* Load ontology IDs from journal into memory */
-		load_ontology_ids_from_journal (&uri_id_map);
+		load_ontology_ids_from_journal (&uri_id_map, &max_id);
 
 		tracker_db_journal_reader_shutdown ();
 	}



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