[tracker/journal: 5/6] libtracker-data: Do not journal all statements
- From: juergbi src gnome org
- To: commits-list gnome org
- Cc:
- Subject: [tracker/journal: 5/6] libtracker-data: Do not journal all statements
- Date: Wed, 2 Feb 2011 11:08:11 +0000 (UTC)
commit 2d35e2edcb4925d5d051efaac75c00b9ba73ee4a
Author: Jürg Billeter <j bitron ch>
Date: Tue Feb 1 16:58:24 2011 +0100
libtracker-data: Do not journal all statements
Do not journal statements that are inserted by tracker-miner-fs and
whose predicate has tracker:journal set to false.
src/libtracker-data/tracker-data-update.c | 35 ++++++++++++++++++++++------
1 files changed, 27 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 52868d2..29fdab5 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -28,6 +28,8 @@
#include <libtracker-common/tracker-file-utils.h>
#include <libtracker-common/tracker-ontologies.h>
+#include <libtracker-miner/tracker-miner-common.h>
+
#include "tracker-class.h"
#include "tracker-data-manager.h"
#include "tracker-data-update.h"
@@ -2070,10 +2072,15 @@ tracker_data_delete_statement (const gchar *graph,
object_id = 0;
tried = TRUE;
- tracker_db_journal_append_delete_statement (graph_id,
- resource_buffer->id,
- pred_id,
- object);
+ if (!tracker_property_get_journal (field) &&
+ g_strcmp0 (graph, TRACKER_MINER_FS_GRAPH_URN) == 0) {
+ /* do not journl */
+ } else {
+ tracker_db_journal_append_delete_statement (graph_id,
+ resource_buffer->id,
+ pred_id,
+ object);
+ }
}
}
} else {
@@ -2399,10 +2406,22 @@ tracker_data_insert_statement_with_string (const gchar *graph,
graph_id = (graph != NULL ? query_resource_id (graph) : 0);
pred_id = (pred_id != 0) ? pred_id : tracker_data_query_resource_id (predicate);
}
- tracker_db_journal_append_insert_statement (graph_id,
- resource_buffer->id,
- pred_id,
- object);
+ if (!tracker_property_get_journal (property) &&
+ g_strcmp0 (graph, TRACKER_MINER_FS_GRAPH_URN) == 0) {
+ /* do not journal this statement extracted from filesystem */
+ TrackerProperty *damaged;
+
+ damaged = tracker_ontologies_get_property_by_uri (TRACKER_TRACKER_PREFIX "damaged");
+ tracker_db_journal_append_insert_statement (graph_id,
+ resource_buffer->id,
+ tracker_property_get_id (damaged),
+ "true");
+ } else {
+ tracker_db_journal_append_insert_statement (graph_id,
+ resource_buffer->id,
+ pred_id,
+ object);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]