[gnome-software/wip/hughsie/no-claim-wildcard: 5/5] Remove the wildcard apps afterthe very first refine call



commit e82fb6e7e403118e1af9b1f525ee7db9e8b46554
Author: Richard Hughes <richard hughsie com>
Date:   Tue Jul 16 09:53:26 2019 +0100

    Remove the wildcard apps afterthe very first refine call
    
    If we have filter flags set then gs_plugin_loader_run_refine_filter() is called
    indirectly twice, so all the wildcards get added again as they're only removed
    in gs_plugin_loader_run_refine().
    
    Fixes the other half of https://gitlab.gnome.org/GNOME/gnome-software/issues/736

 lib/gs-plugin-loader.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index 449d4f4a..9db275f4 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -769,6 +769,12 @@ gs_plugin_loader_call_vfunc (GsPluginLoaderHelper *helper,
        return TRUE;
 }
 
+static gboolean
+gs_plugin_loader_app_is_non_wildcard (GsApp *app, gpointer user_data)
+{
+       return !gs_app_has_quirk (app, GS_APP_QUIRK_IS_WILDCARD);
+}
+
 static gboolean
 gs_plugin_loader_run_refine_filter (GsPluginLoaderHelper *helper,
                                    GsAppList *list,
@@ -809,13 +815,11 @@ gs_plugin_loader_run_refine_filter (GsPluginLoaderHelper *helper,
                }
                gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_FINISHED);
        }
-       return TRUE;
-}
 
-static gboolean
-gs_plugin_loader_app_is_non_wildcard (GsApp *app, gpointer user_data)
-{
-       return !gs_app_has_quirk (app, GS_APP_QUIRK_IS_WILDCARD);
+
+       /* filter any MATCH_ANY_PREFIX apps left in the list */
+       gs_app_list_filter (list, gs_plugin_loader_app_is_non_wildcard, NULL);
+       return TRUE;
 }
 
 static gboolean
@@ -970,9 +974,6 @@ gs_plugin_loader_run_refine (GsPluginLoaderHelper *helper,
        if (!ret)
                goto out;
 
-       /* filter any MATCH_ANY_PREFIX apps left in the list */
-       gs_app_list_filter (list, gs_plugin_loader_app_is_non_wildcard, NULL);
-
        /* remove any addons that have the same source as the parent app */
        for (guint i = 0; i < gs_app_list_length (list); i++) {
                g_autoptr(GPtrArray) to_remove = g_ptr_array_new ();


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