[tracker/binary-log] libtracker-data: Append deleted statements to journal



commit 0accfc96b864bd667bcbc9eab26f28467cb034e5
Author: Jürg Billeter <j bitron ch>
Date:   Wed Dec 30 11:14:14 2009 +0100

    libtracker-data: Append deleted statements to journal

 src/libtracker-data/tracker-data-update.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 457af70..4d68f59 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -1274,6 +1274,10 @@ tracker_data_delete_statement (const gchar  *graph,
 	if (object && g_strcmp0 (predicate, RDF_PREFIX "type") == 0) {
 		class = tracker_ontology_get_class_by_uri (object);
 		if (class != NULL) {
+			tracker_db_journal_append_delete_statement_code (resource_buffer->id,
+				tracker_data_query_resource_id (predicate),
+				tracker_data_query_resource_id (object));
+
 			cache_delete_resource_type (class, graph);
 		} else {
 			g_set_error (error, TRACKER_DATA_ERROR, TRACKER_DATA_ERROR_UNKNOWN_CLASS,
@@ -1282,6 +1286,16 @@ tracker_data_delete_statement (const gchar  *graph,
 	} else {
 		field = tracker_ontology_get_property_by_uri (predicate);
 		if (field != NULL) {
+			if (tracker_property_get_data_type (field) == TRACKER_PROPERTY_TYPE_RESOURCE) {
+				tracker_db_journal_append_delete_statement_code (resource_buffer->id,
+					tracker_data_query_resource_id (predicate),
+					tracker_data_query_resource_id (object));
+			} else {
+				tracker_db_journal_append_delete_statement (resource_buffer->id,
+					tracker_data_query_resource_id (predicate),
+					object);
+			}
+
 			delete_metadata_decomposed (field, object, error);
 		} else {
 			g_set_error (error, TRACKER_DATA_ERROR, TRACKER_DATA_ERROR_UNKNOWN_PROPERTY,



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