[tracker/ontology-cope: 8/9] libtracker-data: Update the nao:lastModified of the tracker:Ontology



commit 62fb99128090630bc8e050f785cb61d47e3d63fb
Author: Philip Van Hoof <philip codeminded be>
Date:   Thu Feb 18 15:47:17 2010 +0100

    libtracker-data: Update the nao:lastModified of the tracker:Ontology

 src/libtracker-data/tracker-data-manager.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 90ca28d..b734468 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -1641,6 +1641,7 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 		for (l = sorted; l; l = l->next) {
 			TrackerOntology *ontology;
 			const gchar *ontology_file = l->data;
+			const gchar *ontology_uri;
 			gboolean found;
 			gpointer value;
 
@@ -1652,8 +1653,10 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 				continue;
 			}
 
+			ontology_uri = tracker_ontology_get_uri (ontology);
+
 			found = g_hash_table_lookup_extended (ontos_table,
-			                                      tracker_ontology_get_uri (ontology),
+			                                      ontology_uri,
 			                                      NULL, &value);
 
 			if (found) {
@@ -1675,6 +1678,20 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 
 					load_ontology_file (ontology_file, &max_id, TRUE);
 					to_reload = g_list_prepend (to_reload, l->data);
+
+					stmt = tracker_db_interface_create_statement (iface,
+					        "UPDATE \"rdfs:Resource\" SET \"nao:lastModified\"= ? "
+					        "WHERE \"rdfs:Resource\".ID = "
+					        "(SELECT Resource.ID FROM Resource INNER JOIN \"rdfs:Resource\" "
+					        "ON \"rdfs:Resource\".ID = Resource.ID WHERE "
+					        "Resource.Uri = ?)");
+
+					tracker_db_statement_bind_int (stmt, 0, last_mod);
+					tracker_db_statement_bind_text (stmt, 1, ontology_uri);
+					tracker_db_statement_execute (stmt, NULL);
+
+					g_object_unref (stmt);
+
 				}
 
 			}



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