[tracker] Fixes NB#153444, tracker-stats giving incorrect results for contacts after...



commit ea5415dd8d280d622e607ee5b733ab597891ec7d
Author: Martyn Russell <martyn lanedo com>
Date:   Thu Jan 21 10:45:00 2010 +0000

    Fixes NB#153444, tracker-stats giving incorrect results for contacts after...
    
    Classes with multiple inheritance caused multiple decrements to the
    class count which meant tracker-stats was inaccurate.

 src/libtracker-data/tracker-data-update.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 659e904..04a5366 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -513,6 +513,10 @@ tracker_data_resource_buffer_flush (GError **error)
 					return;
 				}
 
+				if (table->class) {
+					tracker_class_set_count (table->class, tracker_class_get_count (table->class) - 1);
+				}
+
 				if (strcmp (table_name, "rdfs:Resource") == 0) {
 					TrackerProperty **properties, *property;
 					guint n_props;
@@ -1280,8 +1284,6 @@ cache_delete_resource_type (TrackerClass *class,
 
 	cache_delete_row (class);
 
-	tracker_class_set_count (class, tracker_class_get_count (class) - 1);
-
 	if (delete_callbacks) {
 		guint n;
 		for (n = 0; n < delete_callbacks->len; n++) {



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