[gnome-software: 54/72] gs-plugin-loader: Drop refine_wildcard vfunc




commit 4bec111beb7a77accc2b8cebecb5a49da4deb945
Author: Philip Withnall <pwithnall endlessos org>
Date:   Mon Nov 22 18:50:17 2021 +0000

    gs-plugin-loader: Drop refine_wildcard vfunc
    
    It’s not implemented by any plugins any more (as per the previous
    commits).
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #1472

 lib/gs-plugin-loader.c | 23 +----------------------
 lib/gs-plugin-vfuncs.h | 24 ------------------------
 2 files changed, 1 insertion(+), 46 deletions(-)
---
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index b3ee747d4..11f34683a 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -623,10 +623,7 @@ gs_plugin_loader_call_vfunc (GsPluginLoaderHelper *helper,
                gs_plugin_interactive_inc (plugin);
        switch (action) {
        case GS_PLUGIN_ACTION_REFINE:
-               if (g_strcmp0 (helper->function_name, "gs_plugin_refine_wildcard") == 0) {
-                       GsPluginRefineWildcardFunc plugin_func = func;
-                       ret = plugin_func (plugin, app, list, refine_flags, cancellable, &error_local);
-               } else if (g_strcmp0 (helper->function_name, "gs_plugin_refine") == 0) {
+               if (g_strcmp0 (helper->function_name, "gs_plugin_refine") == 0) {
                        GsPluginRefineFunc plugin_func = func;
                        ret = plugin_func (plugin, list, refine_flags, cancellable, &error_local);
                } else {
@@ -871,24 +868,6 @@ gs_plugin_loader_run_refine_filter (GsPluginLoaderHelper *helper,
                        return FALSE;
                }
 
-               if (gs_plugin_get_symbol (plugin, "gs_plugin_refine_wildcard") != NULL) {
-                       /* use a copy of the list for the loop because a function called
-                        * on the plugin may affect the list which can lead to problems
-                        * (e.g. inserting an app in the list on every call results in
-                        * an infinite loop) */
-                       app_list = gs_app_list_copy (list);
-                       helper->function_name = "gs_plugin_refine_wildcard";
-
-                       for (guint j = 0; j < gs_app_list_length (app_list); j++) {
-                               GsApp *app = gs_app_list_index (app_list, j);
-                               if (gs_app_has_quirk (app, GS_APP_QUIRK_IS_WILDCARD) &&
-                                   !gs_plugin_loader_call_vfunc (helper, plugin, app, NULL,
-                                                                 refine_flags, cancellable, error)) {
-                                       return FALSE;
-                               }
-                       }
-               }
-
                gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_FINISHED);
        }
 
diff --git a/lib/gs-plugin-vfuncs.h b/lib/gs-plugin-vfuncs.h
index abd24e299..18ec9545d 100644
--- a/lib/gs-plugin-vfuncs.h
+++ b/lib/gs-plugin-vfuncs.h
@@ -355,30 +355,6 @@ gboolean    gs_plugin_add_featured                 (GsPlugin       *plugin,
                                                         GCancellable   *cancellable,
                                                         GError         **error);
 
-/**
- * gs_plugin_refine_wildcard:
- * @plugin: a #GsPlugin
- * @app: a #GsApp
- * @list: a #GsAppList
- * @flags: a #GsPluginRefineFlags, e.g. %GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE
- * @cancellable: a #GCancellable, or %NULL
- * @error: a #GError, or %NULL
- *
- * Adds applications that match the wildcard specified in @app.
- *
- * The general idea is that plugins create and add *new* applications rather
- * than all trying to fight over the wildcard application.
- * This allows the plugin loader to filter using the #GsApp priority value.
- *
- * Returns: %TRUE for success or if not relevant
- **/
-gboolean        gs_plugin_refine_wildcard              (GsPlugin       *plugin,
-                                                        GsApp          *app,
-                                                        GsAppList      *list,
-                                                        GsPluginRefineFlags flags,
-                                                        GCancellable   *cancellable,
-                                                        GError         **error);
-
 /**
  * gs_plugin_launch:
  * @plugin: a #GsPlugin


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