[tracker/journal] libtracker-data: Handle unsupported tracker:transient ontology changes
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/journal] libtracker-data: Handle unsupported tracker:transient ontology changes
- Date: Thu, 14 Oct 2010 14:43:50 +0000 (UTC)
commit 3aa616658d03155a3168a05d5ecbc57270506ab9
Author: Philip Van Hoof <philip codeminded be>
Date: Thu Oct 14 16:31:56 2010 +0200
libtracker-data: Handle unsupported tracker:transient ontology changes
src/libtracker-data/tracker-data-manager.c | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index ed7e194..0b12e7a 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -886,6 +886,7 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
tracker_property_set_secondary_index (property, secondary_index);
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "transient") == 0) {
TrackerProperty *property;
+ gboolean is_new;
property = tracker_ontologies_get_property_by_uri (subject);
if (property == NULL) {
@@ -893,7 +894,25 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
return;
}
- if (tracker_property_get_is_new (property) != in_update) {
+ is_new = tracker_property_get_is_new (property);
+ if (is_new != in_update) {
+ /* Detect unsupported ontology change (this needs a journal replay).
+ * Wouldn't be very hard to support this, just dropping the tabtle
+ * or creating the table in the-non memdisk db file, but afaik this
+ * isn't supported right now */
+ if (in_update == TRUE && is_new == FALSE) {
+ if (check_unsupported_property_value_change (ontology_path,
+ "tracker:transient",
+ subject,
+ predicate,
+ object)) {
+ handle_unsupported_ontology_change (ontology_path,
+ tracker_property_get_name (property),
+ "tracker:transient",
+ tracker_property_get_transient (property) ? "true" : "false",
+ g_strcmp0 (object, "true") ==0 ? "true" : "false");
+ }
+ }
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]