[tracker/ontology-cope] libtracker-data: Don't reset the is_new flags too early
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/ontology-cope] libtracker-data: Don't reset the is_new flags too early
- Date: Mon, 22 Mar 2010 10:46:07 +0000 (UTC)
commit 03d296ed875b2e97c05c139abaacc726b1060c21
Author: Philip Van Hoof <philip codeminded be>
Date: Mon Mar 22 11:44:15 2010 +0100
libtracker-data: Don't reset the is_new flags too early
src/libtracker-data/tracker-data-manager.c | 23 +++++++++++++++++++++--
src/libtracker-data/tracker-data-manager.h | 1 +
src/libtracker-data/tracker-data-update.c | 3 ++-
3 files changed, 24 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index d1e7cf6..79e0419 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -1356,6 +1356,25 @@ create_fts_table (TrackerDBInterface *iface)
g_free (query);
}
+void
+tracker_data_ontology_import_finished (void)
+{
+ TrackerClass **classes;
+ TrackerProperty **properties;
+ gint i, n_props, n_classes;
+
+ classes = tracker_ontologies_get_classes (&n_classes);
+ properties = tracker_ontologies_get_properties (&n_props);
+
+ for (i = 0; i < n_classes; i++) {
+ tracker_class_set_is_new (classes[i], FALSE);
+ }
+
+ for (i = 0; i < n_props; i++) {
+ tracker_property_set_is_new (properties[i], FALSE);
+ }
+}
+
void
tracker_data_ontology_import_into_db (gboolean is_new)
{
@@ -1385,7 +1404,6 @@ tracker_data_ontology_import_into_db (gboolean is_new)
insert_uri_in_resource_table (iface, tracker_class_get_uri (classes[i]),
tracker_class_get_id (classes[i]));
}
- tracker_class_set_is_new (classes[i], FALSE);
}
/* insert properties into rdfs:Resource table and set all properties to not new */
@@ -1394,7 +1412,6 @@ tracker_data_ontology_import_into_db (gboolean is_new)
insert_uri_in_resource_table (iface, tracker_property_get_uri (properties[i]),
tracker_property_get_id (properties[i]));
}
- tracker_property_set_is_new (properties[i], FALSE);
}
}
@@ -1717,6 +1734,8 @@ tracker_data_manager_init (TrackerDBManagerFlags flags,
g_list_free (to_reload);
}
+ tracker_data_ontology_import_finished ();
+
tracker_db_journal_commit_db_transaction ();
tracker_data_commit_db_transaction ();
diff --git a/src/libtracker-data/tracker-data-manager.h b/src/libtracker-data/tracker-data-manager.h
index 7b89b4f..83d5212 100644
--- a/src/libtracker-data/tracker-data-manager.h
+++ b/src/libtracker-data/tracker-data-manager.h
@@ -62,6 +62,7 @@ void tracker_data_ontology_process_statement (const gchar *graph,
gboolean is_uri,
gboolean is_new,
gboolean ignore_nao_last_modified);
+void tracker_data_ontology_import_finished (void);
G_END_DECLS
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 7a7be49..d5f9566 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2316,6 +2316,8 @@ ontology_transaction_end (GList *ontology_queue)
tracker_db_statement_execute (stmt, NULL);
}
}
+
+ tracker_data_ontology_import_finished ();
}
static GList*
@@ -2632,7 +2634,6 @@ tracker_data_replay_journal (GHashTable *classes,
}
}
-
if (journal_error) {
gsize size;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]