[gnome-photos/wip/rishi/collection: 18/18] offset-controller: Log the number of items



commit b0b527036e18cafc6dffd74aedbd857e3fa5b9c4
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Feb 14 21:18:58 2018 +0100

    offset-controller: Log the number of items
    
    It is useful to know the total number of items seen by a
    OffsetController when debugging whether the ViewContainer should be
    pulling in more items when scrolling down.

 src/photos-offset-controller.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/photos-offset-controller.c b/src/photos-offset-controller.c
index 19fdedb1..501166c2 100644
--- a/src/photos-offset-controller.c
+++ b/src/photos-offset-controller.c
@@ -27,6 +27,7 @@
 #include <tracker-sparql.h>
 
 #include "egg-counter.h"
+#include "photos-debug.h"
 #include "photos-offset-controller.h"
 #include "photos-query-builder.h"
 #include "photos-tracker-queue.h"
@@ -90,7 +91,13 @@ photos_offset_controller_cursor_next (GObject *source_object, GAsyncResult *res,
 
   if (success)
     {
+      const gchar *type_name;
+
       priv->count = (gint) tracker_sparql_cursor_get_integer (cursor, 0);
+
+      type_name = G_OBJECT_TYPE_NAME (self);
+      photos_debug (PHOTOS_DEBUG_TRACKER, "%s has %d items", type_name, priv->count);
+
       g_signal_emit (self, signals[COUNT_CHANGED], 0, priv->count);
     }
 


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