[tracker/transient-journal] Revert "libtracker-data: Don't journal and don't tracker:modified transient properties"



commit 83112de7c441d05a7cbc015d93edbb063fa95449
Author: Philip Van Hoof <philip codeminded be>
Date:   Tue Jan 25 15:16:35 2011 +0100

    Revert "libtracker-data: Don't journal and don't tracker:modified transient properties"
    
    This reverts commit 1cc50a4617d31a6c86a775c60179510f87a9a9a5.

 src/libtracker-data/tracker-data-update.c |   57 +++++++++++------------------
 1 files changed, 22 insertions(+), 35 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index ae8544a..fedad7f 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -1903,11 +1903,10 @@ cache_delete_resource_type (TrackerClass *class,
 }
 
 static void
-resource_buffer_switch (const gchar     *graph,
-                        gint             graph_id,
-                        const gchar     *subject,
-                        gint             subject_id,
-                        TrackerProperty *property)
+resource_buffer_switch (const gchar *graph,
+                        gint         graph_id,
+                        const gchar *subject,
+                        gint         subject_id)
 {
 	if (in_journal_replay) {
 		/* journal replay only provides subject id
@@ -1934,7 +1933,6 @@ resource_buffer_switch (const gchar     *graph,
 
 		/* subject not yet in cache, retrieve or create ID */
 		resource_buffer = g_slice_new0 (TrackerDataUpdateBufferResource);
-
 		if (subject != NULL) {
 			subject_dup = g_strdup (subject);
 			resource_buffer->subject = subject_dup;
@@ -1964,15 +1962,6 @@ resource_buffer_switch (const gchar     *graph,
 				graph_id = ensure_resource_id (graph, NULL);
 			}
 		}
-
-		if (!property || !tracker_property_get_transient (property)) {
-			GValue gvalue = { 0 };
-			g_value_init (&gvalue, G_TYPE_INT64);
-			g_value_set_int64 (&gvalue, tracker_data_update_get_next_modseq ());
-			cache_insert_value ("rdfs:Resource", "tracker:modified", &gvalue,
-			                    0,
-			                    FALSE, FALSE, FALSE);
-		}
 	}
 }
 
@@ -2000,14 +1989,12 @@ tracker_data_delete_statement (const gchar  *graph,
 		return;
 	}
 
-	field = tracker_ontologies_get_property_by_uri (predicate);
-
-	resource_buffer_switch (graph, 0, subject, subject_id, field);
+	resource_buffer_switch (graph, 0, subject, subject_id);
 
 	if (object && g_strcmp0 (predicate, RDF_PREFIX "type") == 0) {
 		class = tracker_ontologies_get_class_by_uri (object);
 		if (class != NULL) {
-			if (!in_journal_replay && !tracker_property_get_transient (field)) {
+			if (!in_journal_replay) {
 				tracker_db_journal_append_delete_statement_id (
 				       (graph != NULL ? query_resource_id (graph) : 0),
 				       resource_buffer->id,
@@ -2023,9 +2010,10 @@ tracker_data_delete_statement (const gchar  *graph,
 		gint pred_id = 0, graph_id = 0, object_id = 0;
 		gboolean tried = FALSE;
 
+		field = tracker_ontologies_get_property_by_uri (predicate);
 		if (field != NULL) {
 			change = delete_metadata_decomposed (field, object, 0, error);
-			if (!in_journal_replay && change && !tracker_property_get_transient (field)) {
+			if (!in_journal_replay && change) {
 				if (tracker_property_get_data_type (field) == TRACKER_PROPERTY_TYPE_RESOURCE) {
 
 					pred_id = tracker_property_get_id (field);
@@ -2084,7 +2072,6 @@ static gboolean
 tracker_data_insert_statement_common (const gchar            *graph,
                                       const gchar            *subject,
                                       const gchar            *predicate,
-                                      TrackerProperty        *property,
                                       const gchar            *object,
                                       GError                **error)
 {
@@ -2126,7 +2113,7 @@ tracker_data_insert_statement_common (const gchar            *graph,
 		return FALSE;
 	}
 
-	resource_buffer_switch (graph, 0, subject, 0, property);
+	resource_buffer_switch (graph, 0, subject, 0);
 
 	return TRUE;
 }
@@ -2227,7 +2214,7 @@ tracker_data_insert_statement_with_uri (const gchar            *graph,
 		}
 	}
 
-	if (!tracker_data_insert_statement_common (graph, subject, predicate, property, object, &actual_error)) {
+	if (!tracker_data_insert_statement_common (graph, subject, predicate, object, &actual_error)) {
 		if (actual_error) {
 			g_propagate_error (error, actual_error);
 			return;
@@ -2248,7 +2235,7 @@ tracker_data_insert_statement_with_uri (const gchar            *graph,
 			return;
 		}
 
-		if (!in_journal_replay && !tracker_property_get_transient (property)) {
+		if (!in_journal_replay) {
 			graph_id = (graph != NULL ? query_resource_id (graph) : 0);
 			final_prop_id = (prop_id != 0) ? prop_id : tracker_data_query_resource_id (predicate);
 			object_id = query_resource_id (object);
@@ -2284,12 +2271,12 @@ tracker_data_insert_statement_with_uri (const gchar            *graph,
 		}
 	}
 
-	if (!in_journal_replay && change && !tracker_property_get_transient (property)) {
+	if (!in_journal_replay && change) {
 		tracker_db_journal_append_insert_statement_id (
-		       (graph != NULL ? query_resource_id (graph) : 0),
-		       resource_buffer->id,
-		       final_prop_id,
-		       object_id);
+			(graph != NULL ? query_resource_id (graph) : 0),
+			resource_buffer->id,
+			final_prop_id,
+			object_id);
 	}
 }
 
@@ -2325,7 +2312,7 @@ tracker_data_insert_statement_with_string (const gchar            *graph,
 		pred_id = tracker_property_get_id (property);
 	}
 
-	if (!tracker_data_insert_statement_common (graph, subject, predicate, property, object, &actual_error)) {
+	if (!tracker_data_insert_statement_common (graph, subject, predicate, object, &actual_error)) {
 		if (actual_error) {
 			g_propagate_error (error, actual_error);
 			return;
@@ -2360,7 +2347,7 @@ tracker_data_insert_statement_with_string (const gchar            *graph,
 		}
 	}
 
-	if (!in_journal_replay && change && !tracker_property_get_transient (property)) {
+	if (!in_journal_replay && change) {
 		if (!tried) {
 			graph_id = (graph != NULL ? query_resource_id (graph) : 0);
 			pred_id = (pred_id != 0) ? pred_id : tracker_data_query_resource_id (predicate);
@@ -2669,7 +2656,7 @@ tracker_data_replay_journal (TrackerBusyCallback  busy_callback,
 			}
 
 			if (property) {
-				resource_buffer_switch (NULL, graph_id, NULL, subject_id, NULL);
+				resource_buffer_switch (NULL, graph_id, NULL, subject_id);
 
 				cache_set_metadata_decomposed (property, object, 0, NULL, graph_id, &new_error);
 
@@ -2707,7 +2694,7 @@ tracker_data_replay_journal (TrackerBusyCallback  busy_callback,
 				if (tracker_property_get_data_type (property) != TRACKER_PROPERTY_TYPE_RESOURCE) {
 					g_warning ("Journal replay error: 'property with ID %d does not account URIs'", predicate_id);
 				} else {
-					resource_buffer_switch (NULL, graph_id, NULL, subject_id, NULL);
+					resource_buffer_switch (NULL, graph_id, NULL, subject_id);
 
 					if (property == rdf_type) {
 						uri = tracker_ontologies_get_uri_by_id (object_id);
@@ -2750,7 +2737,7 @@ tracker_data_replay_journal (TrackerBusyCallback  busy_callback,
 			}
 			last_operation_type = -1;
 
-			resource_buffer_switch (NULL, graph_id, NULL, subject_id, NULL);
+			resource_buffer_switch (NULL, graph_id, NULL, subject_id);
 
 			uri = tracker_ontologies_get_uri_by_id (predicate_id);
 			if (uri) {
@@ -2808,7 +2795,7 @@ tracker_data_replay_journal (TrackerBusyCallback  busy_callback,
 
 			if (property) {
 
-				resource_buffer_switch (NULL, graph_id, NULL, subject_id, NULL);
+				resource_buffer_switch (NULL, graph_id, NULL, subject_id);
 
 				if (property == rdf_type) {
 					uri = tracker_ontologies_get_uri_by_id (object_id);



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