[tracker/persistent-modified] libtracker-data: Set has_persistent when deleting rdf:type statements
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/persistent-modified] libtracker-data: Set has_persistent when deleting rdf:type statements
- Date: Mon, 31 Jan 2011 13:05:38 +0000 (UTC)
commit 499ea0718f5354dc69c7db196383bd0ecb5c5260
Author: Jürg Billeter <j bitron ch>
Date: Mon Jan 31 14:04:02 2011 +0100
libtracker-data: Set has_persistent when deleting rdf:type statements
This moves has_persistent assignments from low level functions to the
higher level insert_statement and delete_statement functions as it
is easier to cover all cases that way.
src/libtracker-data/tracker-data-update.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 94d654e..7811581 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -564,10 +564,6 @@ cache_insert_value (const gchar *table_name,
#endif
property.date_time = date_time;
- if (!transient) {
- has_persistent = TRUE;
- }
-
table = cache_ensure_table (table_name, multiple_values, transient);
g_array_append_val (table->properties, property);
}
@@ -602,10 +598,6 @@ cache_delete_value (const gchar *table_name,
#endif
property.date_time = date_time;
- if (!transient) {
- has_persistent = TRUE;
- }
-
table = cache_ensure_table (table_name, multiple_values, transient);
table->delete_value = TRUE;
g_array_append_val (table->properties, property);
@@ -2034,6 +2026,8 @@ tracker_data_delete_statement (const gchar *graph,
if (object && g_strcmp0 (predicate, RDF_PREFIX "type") == 0) {
class = tracker_ontologies_get_class_by_uri (object);
if (class != NULL) {
+ has_persistent = TRUE;
+
if (!in_journal_replay) {
tracker_db_journal_append_delete_statement_id (
(graph != NULL ? query_resource_id (graph) : 0),
@@ -2053,6 +2047,10 @@ tracker_data_delete_statement (const gchar *graph,
field = tracker_ontologies_get_property_by_uri (predicate);
if (field != NULL) {
+ if (!tracker_property_get_transient (field)) {
+ has_persistent = TRUE;
+ }
+
change = delete_metadata_decomposed (field, object, 0, error);
if (!in_journal_replay && change && !tracker_property_get_transient (field)) {
if (tracker_property_get_data_type (field) == TRACKER_PROPERTY_TYPE_RESOURCE) {
@@ -2175,6 +2173,10 @@ tracker_data_insert_statement (const gchar *graph,
property = tracker_ontologies_get_property_by_uri (predicate);
if (property != NULL) {
+ if (!tracker_property_get_transient (property)) {
+ has_persistent = TRUE;
+ }
+
if (tracker_property_get_data_type (property) == TRACKER_PROPERTY_TYPE_RESOURCE) {
tracker_data_insert_statement_with_uri (graph, subject, predicate, object, error);
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]