[tracker] libtracker-data: Test for domainIndex already being a first-class property



commit 94a7f871507e35caf893c84ed2f830b2743636e1
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Jul 14 10:17:42 2010 +0200

    libtracker-data: Test for domainIndex already being a first-class property

 src/libtracker-data/tracker-data-manager.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 8006536..283b941 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -536,6 +536,7 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
 		TrackerProperty **properties;
 		gboolean ignore = FALSE;
 		gboolean had = FALSE;
+		guint n_props, i;
 
 		class = tracker_ontologies_get_class_by_uri (subject);
 
@@ -573,6 +574,15 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
 			return;
 		}
 
+		properties = tracker_ontologies_get_properties (&n_props);
+		for (i = 0; i < n_props; i++) {
+			if (tracker_property_get_domain (properties[i]) == class &&
+			    properties[i] == property) {
+				g_critical ("%s: Property %s is already a first-class property of %s while trying to add it as tracker:domainIndex",
+				            ontology_path, object, subject);
+			}
+		}
+
 		properties = tracker_class_get_domain_indexes (class);
 		while (*properties) {
 			if (property == *properties) {



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