[gnome-software: 9/15] dummy: Use GsPluginJobListApps rather than ACTION_GET_POPULAR




commit 270cbb1a9717738685906fbcbe1ae771f0bed4be
Author: Philip Withnall <pwithnall endlessos org>
Date:   Tue May 3 16:52:02 2022 +0100

    dummy: 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

 plugins/dummy/gs-self-test.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/plugins/dummy/gs-self-test.c b/plugins/dummy/gs-self-test.c
index faca17711..010e822f4 100644
--- a/plugins/dummy/gs-self-test.c
+++ b/plugins/dummy/gs-self-test.c
@@ -578,11 +578,14 @@ gs_plugins_dummy_wildcard_func (GsPluginLoader *plugin_loader)
        const gchar *popular_override = "chiron.desktop,zeus.desktop";
        g_auto(GStrv) apps = NULL;
        g_autoptr(GsPluginJob) plugin_job = NULL;
+       g_autoptr(GsAppQuery) query = NULL;
+
+       /* use the plugin's default curated list */
+       query = gs_app_query_new ("is-curated", GS_APP_QUERY_TRISTATE_TRUE,
+                                 "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+                                 NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
 
-       /* use the plugin's default popular list */
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_GET_POPULAR,
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
-                                        NULL);
        list1 = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -592,9 +595,13 @@ gs_plugins_dummy_wildcard_func (GsPluginLoader *plugin_loader)
        /* override the list */
        g_setenv ("GNOME_SOFTWARE_POPULAR", popular_override, TRUE);
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_GET_POPULAR,
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
-                                        NULL);
+       g_object_unref (query);
+
+       query = gs_app_query_new ("is-curated", GS_APP_QUERY_TRISTATE_TRUE,
+                                 "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+                                 NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
+
        list2 = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);


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