[tracker] libtracker-data: Handle unsupported tracker:isAnnotation ontology changes
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Handle unsupported tracker:isAnnotation ontology changes
- Date: Mon, 25 Oct 2010 12:54:43 +0000 (UTC)
commit 3f2fdf40604a2a8ae418d97cfbced7975eb7bdf8
Author: Philip Van Hoof <philip codeminded be>
Date: Thu Oct 14 16:39:35 2010 +0200
libtracker-data: Handle unsupported tracker:isAnnotation ontology changes
src/libtracker-data/tracker-data-manager.c | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 0b12e7a..5a0e6c9 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -848,8 +848,8 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
handle_unsupported_ontology_change (ontology_path,
tracker_property_get_name (property),
"nrl:maxCardinality",
- tracker_property_get_multiple_values (property) ? "true" : "false",
- (atoi (object) == 1) ? "false" : "true");
+ tracker_property_get_multiple_values (property) ? "1" : "0",
+ (atoi (object) == 1) ? "1" : "0");
}
}
return;
@@ -921,6 +921,7 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
}
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "isAnnotation") == 0) {
TrackerProperty *property;
+ gboolean is_new;
property = tracker_ontologies_get_property_by_uri (subject);
if (property == NULL) {
@@ -928,7 +929,22 @@ 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) */
+ if (in_update == TRUE && is_new == FALSE) {
+ if (check_unsupported_property_value_change (ontology_path,
+ "tracker:isAnnotation",
+ subject,
+ predicate,
+ object)) {
+ handle_unsupported_ontology_change (ontology_path,
+ tracker_property_get_name (property),
+ "tracker:isAnnotation",
+ !tracker_property_get_embedded (property) ? "true" : "false",
+ object);
+ }
+ }
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]