[tracker] tracker-store: class-signal: Fixed a bug, emit all triples for rdf:type predicate
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tracker-store: class-signal: Fixed a bug, emit all triples for rdf:type predicate
- Date: Fri, 3 Sep 2010 14:09:34 +0000 (UTC)
commit 0a8cdc977d5c4572c1e0ca850867bc73d68eaad8
Author: Philip Van Hoof <philip codeminded be>
Date: Fri Sep 3 15:55:22 2010 +0200
tracker-store: class-signal: Fixed a bug, emit all triples for rdf:type predicate
src/tracker-store/tracker-events.c | 103 ++++++-----------------------------
1 files changed, 18 insertions(+), 85 deletions(-)
---
diff --git a/src/tracker-store/tracker-events.c b/src/tracker-store/tracker-events.c
index 0bc13f3..001edb3 100644
--- a/src/tracker-store/tracker-events.c
+++ b/src/tracker-store/tracker-events.c
@@ -73,7 +73,7 @@ tracker_events_add_insert (gint graph_id,
const gchar *object,
GPtrArray *rdf_types)
{
- TrackerProperty *rdf_type;
+ guint i;
g_return_if_fail (rdf_types != NULL);
g_return_if_fail (private != NULL);
@@ -82,47 +82,14 @@ tracker_events_add_insert (gint graph_id,
return;
}
- rdf_type = tracker_ontologies_get_rdf_type ();
-
- if (object_id != 0 && pred_id == tracker_property_get_id (rdf_type)) {
- /* Resource create
- * In case of create, object is the rdf:type */
- if (is_allowed (private, NULL, object_id)) {
- TrackerClass *class = NULL;
-
- if (rdf_types->len == 1 && tracker_class_get_id (rdf_types->pdata[0]) == object_id) {
- class = rdf_types->pdata[0];
- } else {
- if (object == NULL) {
- const gchar *uri = tracker_ontologies_get_uri_by_id (object_id);
- if (uri != NULL)
- class = tracker_ontologies_get_class_by_uri (uri);
- } else {
- class = tracker_ontologies_get_class_by_uri (object);
- }
- }
-
- if (class) {
- tracker_class_add_insert_event (class,
- graph_id,
- subject_id,
- pred_id,
- object_id);
- private->total++;
- }
- }
- } else {
- guint i;
-
- for (i = 0; i < rdf_types->len; i++) {
- if (is_allowed (private, rdf_types->pdata[i], 0)) {
- tracker_class_add_insert_event (rdf_types->pdata[i],
- graph_id,
- subject_id,
- pred_id,
- object_id);
- private->total++;
- }
+ for (i = 0; i < rdf_types->len; i++) {
+ if (is_allowed (private, rdf_types->pdata[i], 0)) {
+ tracker_class_add_insert_event (rdf_types->pdata[i],
+ graph_id,
+ subject_id,
+ pred_id,
+ object_id);
+ private->total++;
}
}
}
@@ -136,7 +103,7 @@ tracker_events_add_delete (gint graph_id,
const gchar *object,
GPtrArray *rdf_types)
{
- TrackerProperty *rdf_type;
+ guint i;
g_return_if_fail (rdf_types != NULL);
g_return_if_fail (private != NULL);
@@ -145,50 +112,16 @@ tracker_events_add_delete (gint graph_id,
return;
}
- rdf_type = tracker_ontologies_get_rdf_type ();
-
- if (object_id != 0 && pred_id == tracker_property_get_id (rdf_type)) {
- /* Resource delete
- * In case of delete, object is the rdf:type */
- if (is_allowed (private, NULL, object_id)) {
- TrackerClass *class = NULL;
-
- if (rdf_types->len == 1 && tracker_class_get_id (rdf_types->pdata[0]) == object_id) {
- class = rdf_types->pdata[0];
- } else {
- if (object == NULL) {
- const gchar *uri = tracker_ontologies_get_uri_by_id (object_id);
- if (uri != NULL)
- class = tracker_ontologies_get_class_by_uri (uri);
- } else {
- class = tracker_ontologies_get_class_by_uri (object);
- }
- }
-
- if (class) {
- tracker_class_add_delete_event (class,
- graph_id,
- subject_id,
- pred_id,
- object_id);
- private->total++;
- }
- }
- } else {
- guint i;
-
- for (i = 0; i < rdf_types->len; i++) {
- if (is_allowed (private, rdf_types->pdata[i], 0)) {
- tracker_class_add_delete_event (rdf_types->pdata[i],
- graph_id,
- subject_id,
- pred_id,
- object_id);
- private->total++;
- }
+ for (i = 0; i < rdf_types->len; i++) {
+ if (is_allowed (private, rdf_types->pdata[i], 0)) {
+ tracker_class_add_delete_event (rdf_types->pdata[i],
+ graph_id,
+ subject_id,
+ pred_id,
+ object_id);
+ private->total++;
}
}
-
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]