diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c index fef084232dbc97ed2ec48f50d2e4d8e27d18156a..74e9db58cc5e703fe49954daaa133a37ded866b2 100644 --- a/lib/gs-plugin-loader.c +++ b/lib/gs-plugin-loader.c @@ -790,20 +790,24 @@ gs_plugin_loader_run_refine_filter (GsPluginLoaderHelper *helper, return FALSE; } - /* 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) */ - helper->function_name = "gs_plugin_refine_wildcard"; - app_list = gs_app_list_copy (list); - 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; + 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); } @@ -3058,6 +3062,7 @@ gs_plugin_loader_process_thread_cb (GTask *task, GsPluginRefineFlags filter_flags; GsPluginRefineFlags refine_flags; gboolean add_to_pending_array = FALSE; + guint max_results; /* these change the pending count on the installed panel */ switch (action) { @@ -3169,9 +3174,11 @@ gs_plugin_loader_process_thread_cb (GTask *task, break; } - /* refine with enough data so that the sort_func can do what it needs */ + /* refine with enough data so that the sort_func in + * gs_plugin_loader_job_sorted_truncation() can do what it needs */ filter_flags = gs_plugin_job_get_filter_flags (helper->plugin_job); - if (filter_flags > 0) { + max_results = gs_plugin_job_get_max_results (helper->plugin_job); + if (filter_flags > 0 && max_results > 0) { g_autoptr(GsPluginLoaderHelper) helper2 = NULL; g_autoptr(GsPluginJob) plugin_job = NULL; plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,