[gnome-software: 6/7] gs-overview-page: Restrict number of curated apps results




commit 45f06da2196265b282b38a44ca102813087223e9
Author: Philip Withnall <pwithnall endlessos org>
Date:   Tue May 24 16:24:47 2022 +0100

    gs-overview-page: Restrict number of curated apps results
    
    The curated apps query can accurately represent all the filtering which
    needs to happen to the results list, so the max-results for the query
    doesn’t need to exceed the number of curated app tiles we want to show.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 src/gs-overview-page.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-overview-page.c b/src/gs-overview-page.c
index a6301ee8b..d7e2a40c3 100644
--- a/src/gs-overview-page.c
+++ b/src/gs-overview-page.c
@@ -150,10 +150,11 @@ gs_overview_page_get_curated_cb (GObject *source_object,
                goto out;
        }
 
+       g_assert (gs_app_list_length (list) == N_TILES);
 
        gs_widget_remove_all (self->box_curated, (GsRemoveFunc) gtk_flow_box_remove);
 
-       for (i = 0; i < gs_app_list_length (list) && i < N_TILES; i++) {
+       for (i = 0; i < gs_app_list_length (list); i++) {
                app = gs_app_list_index (list, i);
                tile = gs_summary_tile_new (app);
                g_signal_connect (tile, "clicked",
@@ -511,7 +512,7 @@ gs_overview_page_load (GsOverviewPage *self)
                GsPluginListAppsFlags flags = GS_PLUGIN_LIST_APPS_FLAGS_INTERACTIVE;
 
                query = gs_app_query_new ("is-curated", GS_APP_QUERY_TRISTATE_TRUE,
-                                         "max-results", 20,
+                                         "max-results", N_TILES,
                                          "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
                                                          GS_PLUGIN_REFINE_FLAGS_REQUIRE_CATEGORIES |
                                                          GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,


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