[tracker/class-signal: 24/61] tracker-store, libtracker-data: class-signal: Cut at transaction, don't reset



commit 39437054b75ee24742d4204b3369bb3596884524
Author: Philip Van Hoof <philip codeminded be>
Date:   Fri Aug 20 19:13:45 2010 +0200

    tracker-store, libtracker-data: class-signal: Cut at transaction, don't reset

 src/libtracker-data/tracker-class.c   |   18 ++++++++++++++++++
 src/libtracker-data/tracker-class.h   |    1 +
 src/tracker-store/tracker-events.c    |    5 +++--
 src/tracker-store/tracker-resources.c |   11 ++++++++++-
 4 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-data/tracker-class.c b/src/libtracker-data/tracker-class.c
index 676d268..f78c6d9 100644
--- a/src/libtracker-data/tracker-class.c
+++ b/src/libtracker-data/tracker-class.c
@@ -526,6 +526,24 @@ tracker_class_reset_events (TrackerClass *class)
 	TrackerClassPrivate *priv;
 
 	g_return_if_fail (TRACKER_IS_CLASS (class));
+
+	priv = GET_PRIV (class);
+
+	/* Reset */
+	g_array_set_size (priv->deletes.ready.sub_pred_ids, 0);
+	g_array_set_size (priv->deletes.ready.object_ids, 0);
+
+	g_array_set_size (priv->inserts.ready.sub_pred_ids, 0);
+	g_array_set_size (priv->inserts.ready.object_ids, 0);
+
+}
+
+void
+tracker_class_transact_events (TrackerClass *class)
+{
+	TrackerClassPrivate *priv;
+
+	g_return_if_fail (TRACKER_IS_CLASS (class));
 	priv = GET_PRIV (class);
 
 	/* Move */
diff --git a/src/libtracker-data/tracker-class.h b/src/libtracker-data/tracker-class.h
index d3e3fbe..261dab8 100644
--- a/src/libtracker-data/tracker-class.h
+++ b/src/libtracker-data/tracker-class.h
@@ -99,6 +99,7 @@ void              tracker_class_foreach_insert_event   (TrackerClass        *cla
 gboolean          tracker_class_has_insert_events      (TrackerClass        *class);
 gboolean          tracker_class_has_delete_events      (TrackerClass        *class);
 void              tracker_class_reset_events           (TrackerClass        *class);
+void              tracker_class_transact_events        (TrackerClass        *class);
 void              tracker_class_add_delete_event       (TrackerClass        *class,
                                                         gint                 subject_id,
                                                         gint                 pred_id,
diff --git a/src/tracker-store/tracker-events.c b/src/tracker-store/tracker-events.c
index 042eaf8..33c1c2b 100644
--- a/src/tracker-store/tracker-events.c
+++ b/src/tracker-store/tracker-events.c
@@ -173,7 +173,8 @@ tracker_events_reset (void)
 	gpointer key, value;
 
 	g_return_if_fail (private != NULL);
-
+/*
+	 this is wrong atm, check tracker-store.c what the purpose of this is
 	g_hash_table_iter_init (&iter, private->allowances);
 
 	while (g_hash_table_iter_next (&iter, &key, &value)) {
@@ -181,7 +182,7 @@ tracker_events_reset (void)
 
 		tracker_class_reset_events (class);
 	}
-
+*/
 	private->frozen = FALSE;
 }
 
diff --git a/src/tracker-store/tracker-resources.c b/src/tracker-store/tracker-resources.c
index 0d8a15f..d9a0b65 100644
--- a/src/tracker-store/tracker-resources.c
+++ b/src/tracker-store/tracker-resources.c
@@ -617,11 +617,20 @@ on_statements_committed (gpointer user_data)
 	TrackerResources *resources = user_data;
 	GHashTable *writebacks;
 	TrackerResourcesPrivate *priv;
+	GHashTableIter iter;
+	gpointer key, value;
+
+	/* Class signal feature */
 
 	priv = TRACKER_RESOURCES_GET_PRIVATE (resources);
 
 	/* Class signal feature */
-	tracker_events_reset ();
+	tracker_events_classes_iter (&iter);
+
+	while (g_hash_table_iter_next (&iter, &key, &value)) {
+		TrackerClass *class = key;
+		tracker_class_transact_events (class);
+	}
 
 	/* Writeback feature */
 	writebacks = tracker_writeback_get_pending ();



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