[gnome-photos] offset-controller: Log the number of items



commit 739e797e4f878f89682eb7207cf9754b4734e123
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]