[gnome-software: 59/72] gs-plugin-loader: Run an explicit refine after ACTION_GET_POPULAR




commit a20eb54bdadea3a751a26134a0c9aa6673beadfe
Author: Philip Withnall <pwithnall endlessos org>
Date:   Wed Nov 24 14:04:04 2021 +0000

    gs-plugin-loader: Run an explicit refine after ACTION_GET_POPULAR
    
    Previously, the code converted the job from `ACTION_GET_POPULAR` into
    `ACTION_REFINE` and carried on executing.
    
    This is a bit hacky, and gets in the way of current refactoring to split
    out the refine job handling into a separate class. Change it to run an
    explicit refine job on the popular list instead.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #1472

 lib/gs-plugin-loader.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index af19b4d4e..9b80e560b 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -4018,12 +4018,21 @@ gs_plugin_loader_job_process_async (GsPluginLoader *plugin_loader,
                }
                if (apps != NULL && g_strv_length (apps) > 0) {
                        GsAppList *list = gs_plugin_job_get_list (plugin_job);
+                       g_autoptr(GsPluginJob) refine_job = NULL;
+
                        for (guint i = 0; apps[i] != NULL; i++) {
                                g_autoptr(GsApp) app = gs_app_new (apps[i]);
                                gs_app_add_quirk (app, GS_APP_QUIRK_IS_WILDCARD);
                                gs_app_list_add (list, app);
                        }
-                       gs_plugin_job_set_action (plugin_job, GS_PLUGIN_ACTION_REFINE);
+
+                       /* Refine the list of wildcard popular apps and return
+                        * to the caller. */
+                       refine_job = gs_plugin_job_refine_new (list, GS_PLUGIN_REFINE_FLAGS_REQUIRE_ID);
+                       gs_plugin_loader_job_process_async (plugin_loader, refine_job,
+                                                           cancellable,
+                                                           callback, user_data);
+                       return;
                }
        }
 


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