[gnome-software: 63/72] gs-plugin-loader: Avoid a refine action if no refine flags are set




commit ceecc53e7696eb04ad51581e5e04ac1219fa3e42
Author: Philip Withnall <pwithnall endlessos org>
Date:   Tue Dec 7 11:20:15 2021 +0000

    gs-plugin-loader: Avoid a refine action if no refine flags are set
    
    Now that we distinguish between `GS_PLUGIN_REFINE_FLAGS_NONE` and
    `GS_PLUGIN_REFINE_FLAGS_(anything else)`, doing a refine when the flags
    are set to `NONE` is just a waste of time.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #1472
    Helps: #1324

 lib/gs-plugin-loader.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index 0e23489c3..731b881ce 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -3593,7 +3593,9 @@ gs_plugin_loader_process_thread_cb (GTask *task,
        }
 
        /* run refine() on each one if required */
-       if (gs_plugin_job_get_refine_flags (helper->plugin_job) != 0) {
+       if (gs_plugin_job_get_refine_flags (helper->plugin_job) != 0 &&
+           list != NULL &&
+           gs_app_list_length (list) > 0) {
                g_autoptr(GsPluginJob) refine_job = NULL;
                g_autoptr(GAsyncResult) refine_result = NULL;
                g_autoptr(GsAppList) new_list = NULL;


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