[gnome-software: 10/15] gs-overview-page: Use GsPluginJobListApps rather than ACTION_GET_POPULAR




commit 115a77ae7ef87a5a087f5782c603dde999ce975e
Author: Philip Withnall <pwithnall endlessos org>
Date:   Tue May 3 16:52:39 2022 +0100

    gs-overview-page: Use GsPluginJobListApps rather than ACTION_GET_POPULAR
    
    This is another step towards removing `ACTION_GET_POPULAR` and allowing
    plugins to consolidate their vfuncs which list apps.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #1472

 src/gs-overview-page.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/src/gs-overview-page.c b/src/gs-overview-page.c
index a390ef126..ca1f3a279 100644
--- a/src/gs-overview-page.c
+++ b/src/gs-overview-page.c
@@ -515,16 +515,21 @@ gs_overview_page_load (GsOverviewPage *self)
 
        if (!self->loading_popular) {
                g_autoptr(GsPluginJob) plugin_job = NULL;
+               g_autoptr(GsAppQuery) query = NULL;
+               GsPluginListAppsFlags flags = GS_PLUGIN_LIST_APPS_FLAGS_INTERACTIVE;
+
+               query = gs_app_query_new ("is-curated", GS_APP_QUERY_TRISTATE_TRUE,
+                                         "max-results", 20,
+                                         "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
+                                                         GS_PLUGIN_REFINE_FLAGS_REQUIRE_CATEGORIES |
+                                                         GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+                                         "dedupe-flags", GS_APP_LIST_FILTER_FLAG_PREFER_INSTALLED |
+                                                         GS_APP_LIST_FILTER_FLAG_KEY_ID_PROVIDES,
+                                         NULL);
+
+               plugin_job = gs_plugin_job_list_apps_new (query, flags);
 
                self->loading_popular = TRUE;
-               plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_GET_POPULAR,
-                                                "max-results", 20,
-                                                "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
-                                                                GS_PLUGIN_REFINE_FLAGS_REQUIRE_CATEGORIES |
-                                                                GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
-                                                "dedupe-flags", GS_APP_LIST_FILTER_FLAG_PREFER_INSTALLED |
-                                                                GS_APP_LIST_FILTER_FLAG_KEY_ID_PROVIDES,
-                                                NULL);
                gs_plugin_loader_job_process_async (self->plugin_loader,
                                                    plugin_job,
                                                    self->cancellable,


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