[gnome-photos/wip/search: 4/22] query-builder: Default to [0, 50) if no OffsetController is specified



commit 1ed0173d080a0317a38802a0beb5dec2a482045e
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Feb 8 14:37:09 2014 +0100

    query-builder: Default to [0, 50) if no OffsetController is specified

 src/photos-query-builder.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/photos-query-builder.c b/src/photos-query-builder.c
index 9f3a935..e617bfd 100644
--- a/src/photos-query-builder.c
+++ b/src/photos-query-builder.c
@@ -155,11 +155,15 @@ photos_query_builder_query (gboolean global, gint flags, PhotosOffsetController
 
   if (global)
     {
-      gint offset;
-      gint step;
+      gint offset = 0;
+      gint step = 50;
+
+      if (offset_cntrlr != NULL)
+        {
+          offset = photos_offset_controller_get_offset (offset_cntrlr);
+          step = photos_offset_controller_get_step (offset_cntrlr);
+        }
 
-      offset = photos_offset_controller_get_offset (offset_cntrlr);
-      step = photos_offset_controller_get_step (offset_cntrlr);
       tail_sparql = g_strdup_printf ("ORDER BY DESC (?mtime) LIMIT %d OFFSET %d", step, offset);
     }
 


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