[tracker] Revert "libtracker-data: Detect removal of nrl:maxCardinality in ontology and cope"



commit 2035dc707456e429a1b498d22b130b15a0e9cc3e
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Nov 10 20:46:28 2010 +0100

    Revert "libtracker-data: Detect removal of nrl:maxCardinality in ontology and cope"
    
    This reverts commit 00199c35d704a39981c6c3f7345acdcf071427bc.

 src/libtracker-data/tracker-data-manager.c |   43 ++++++----------------------
 src/libtracker-data/tracker-property.c     |   26 -----------------
 src/libtracker-data/tracker-property.h     |    3 --
 3 files changed, 9 insertions(+), 63 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index dabc84b..1303bf2 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -576,10 +576,9 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
 				if (!in_update) {
 					g_critical ("%s: Duplicate definition of property %s", ontology_path, subject);
 				} else {
-					/* Reset for a correct post and pre-check */
+					/* Reset for a correct post-check */
 					tracker_property_reset_domain_indexes (property);
 					tracker_property_set_indexed (property, FALSE);
-					tracker_property_set_last_multiple_values (property, FALSE);
 					tracker_property_set_secondary_index (property, NULL);
 					tracker_property_set_writeback (property, FALSE);
 					tracker_property_set_default_value (property, NULL);
@@ -1267,9 +1266,8 @@ check_for_deleted_domain_index (TrackerClass *class)
 }
 
 static void
-tracker_data_ontology_process_changes_pre_db (GPtrArray  *seen_classes,
-                                              GPtrArray  *seen_properties,
-                                              GError    **error)
+tracker_data_ontology_process_changes_pre_db (GPtrArray *seen_classes,
+                                              GPtrArray *seen_properties)
 {
 	gint i;
 	if (seen_classes) {
@@ -1278,24 +1276,6 @@ tracker_data_ontology_process_changes_pre_db (GPtrArray  *seen_classes,
 			check_for_deleted_domain_index (class);
 		}
 	}
-
-	if (seen_properties) {
-		for (i = 0; i < seen_properties->len; i++) {
-			TrackerProperty *property = g_ptr_array_index (seen_properties, i);
-			gboolean last_multiple_values = tracker_property_get_last_multiple_values (property);
-
-			if (last_multiple_values != tracker_property_get_multiple_values (property)) {
-				const gchar *ontology_path = "Unknown";
-				const gchar *subject = tracker_property_get_uri (property);
-
-				handle_unsupported_ontology_change (ontology_path,
-				                                    subject,
-				                                    "nrl:maxCardinality", "1", "0",
-				                                    error);
-				return;
-			}
-		}
-	}
 }
 
 static void
@@ -2207,7 +2187,6 @@ db_get_static_data (TrackerDBInterface *iface)
 			tracker_property_set_domain (property, tracker_ontologies_get_class_by_uri (domain_uri));
 			tracker_property_set_range (property, tracker_ontologies_get_class_by_uri (range_uri));
 			tracker_property_set_multiple_values (property, multi_valued);
-			tracker_property_set_last_multiple_values (property, multi_valued);
 			tracker_property_set_indexed (property, indexed);
 			tracker_property_set_default_value (property, default_value);
 
@@ -3566,18 +3545,14 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 		if (to_reload) {
 			GError *ontology_error = NULL;
 
-			tracker_data_ontology_process_changes_pre_db (seen_classes,
-			                                              seen_properties,
-			                                              &ontology_error);
+			tracker_data_ontology_process_changes_pre_db (seen_classes, seen_properties);
 
-			if (!ontology_error) {
-				/* Perform ALTER-TABLE and CREATE-TABLE calls for all that are is_new */
-				tracker_data_ontology_import_into_db (TRUE);
+			/* Perform ALTER-TABLE and CREATE-TABLE calls for all that are is_new */
+			tracker_data_ontology_import_into_db (TRUE);
 
-				tracker_data_ontology_process_changes_post_db (seen_classes,
-				                                               seen_properties,
-				                                               &ontology_error);
-			}
+			tracker_data_ontology_process_changes_post_db (seen_classes,
+			                                               seen_properties,
+			                                               &ontology_error);
 
 			if (ontology_error && ontology_error->code == TRACKER_DATA_UNSUPPORTED_ONTOLOGY_CHANGE) {
 				g_debug ("\nUnsupported ontology change, replaying journal\n");
diff --git a/src/libtracker-data/tracker-property.c b/src/libtracker-data/tracker-property.c
index 2f17ded..d29754f 100644
--- a/src/libtracker-data/tracker-property.c
+++ b/src/libtracker-data/tracker-property.c
@@ -57,7 +57,6 @@ struct _TrackerPropertyPrivate {
 	gboolean       fulltext_no_limit;
 	gboolean       embedded;
 	gboolean       multiple_values;
-	gboolean       last_multiple_values;
 	gboolean       transient;
 	gboolean       is_inverse_functional_property;
 	gboolean       is_new;
@@ -469,18 +468,6 @@ tracker_property_get_multiple_values (TrackerProperty *property)
 }
 
 gboolean
-tracker_property_get_last_multiple_values (TrackerProperty *property)
-{
-	TrackerPropertyPrivate *priv;
-
-	g_return_val_if_fail (TRACKER_IS_PROPERTY (property), FALSE);
-
-	priv = GET_PRIV (property);
-
-	return priv->last_multiple_values;
-}
-
-gboolean
 tracker_property_get_is_inverse_functional_property (TrackerProperty *property)
 {
 	TrackerPropertyPrivate *priv;
@@ -882,19 +869,6 @@ tracker_property_set_multiple_values (TrackerProperty *property,
 }
 
 void
-tracker_property_set_last_multiple_values (TrackerProperty *property,
-                                           gboolean         value)
-{
-	TrackerPropertyPrivate *priv;
-
-	g_return_if_fail (TRACKER_IS_PROPERTY (property));
-
-	priv = GET_PRIV (property);
-
-	priv->last_multiple_values = TRUE;
-}
-
-void
 tracker_property_set_is_inverse_functional_property (TrackerProperty *property,
                                                      gboolean         value)
 {
diff --git a/src/libtracker-data/tracker-property.h b/src/libtracker-data/tracker-property.h
index d831938..ee61a8d 100644
--- a/src/libtracker-data/tracker-property.h
+++ b/src/libtracker-data/tracker-property.h
@@ -89,7 +89,6 @@ gboolean            tracker_property_get_fulltext_indexed    (TrackerProperty
 gboolean            tracker_property_get_fulltext_no_limit   (TrackerProperty      *property);
 gboolean            tracker_property_get_embedded            (TrackerProperty      *property);
 gboolean            tracker_property_get_multiple_values     (TrackerProperty      *property);
-gboolean            tracker_property_get_last_multiple_values(TrackerProperty      *property);
 gboolean            tracker_property_get_transient           (TrackerProperty      *property);
 gboolean            tracker_property_get_is_new              (TrackerProperty      *property);
 gboolean            tracker_property_get_is_new_domain_index (TrackerProperty      *property,
@@ -127,8 +126,6 @@ void                tracker_property_set_embedded            (TrackerProperty
                                                               gboolean              value);
 void                tracker_property_set_multiple_values     (TrackerProperty      *property,
                                                               gboolean              value);
-void                tracker_property_set_last_multiple_values(TrackerProperty      *property,
-                                                              gboolean              value);
 void                tracker_property_set_transient           (TrackerProperty      *property,
                                                               gboolean              value);
 void                tracker_property_set_is_new              (TrackerProperty      *property,



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