[gnome-software: 15/20] lib: Drop GS_PLUGIN_ACTION_SEARCH and gs_plugin_add_search()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 15/20] lib: Drop GS_PLUGIN_ACTION_SEARCH and gs_plugin_add_search()
- Date: Mon, 11 Jul 2022 08:41:48 +0000 (UTC)
commit 974241b0ebdf8c146b25a0588a25e9b3560482eb
Author: Philip Withnall <pwithnall endlessos org>
Date: Fri Jul 1 18:10:59 2022 +0100
lib: Drop GS_PLUGIN_ACTION_SEARCH and gs_plugin_add_search()
Neither of them are used any more: instead, plugins and call sites use
`GsPluginJobListApps` with a `GsAppQuery` with `keywords` set.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
Helps: #1472
lib/gs-plugin-loader.c | 30 ------------------------------
lib/gs-plugin-types.h | 2 --
lib/gs-plugin-vfuncs.h | 20 --------------------
lib/gs-plugin.c | 6 ------
4 files changed, 58 deletions(-)
---
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index fecba821c..d76fdcdd7 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -643,13 +643,6 @@ gs_plugin_loader_call_vfunc (GsPluginLoaderHelper *helper,
ret = plugin_func (plugin, list, cancellable, &error_local);
}
break;
- case GS_PLUGIN_ACTION_SEARCH:
- {
- GsPluginSearchFunc plugin_func = func;
- ret = plugin_func (plugin, helper->tokens, list,
- cancellable, &error_local);
- }
- break;
case GS_PLUGIN_ACTION_SEARCH_PROVIDES:
{
GsPluginSearchFunc plugin_func = func;
@@ -3465,7 +3458,6 @@ gs_plugin_loader_process_thread_cb (GTask *task,
case GS_PLUGIN_ACTION_DOWNLOAD:
case GS_PLUGIN_ACTION_LAUNCH:
case GS_PLUGIN_ACTION_REMOVE:
- case GS_PLUGIN_ACTION_SEARCH:
case GS_PLUGIN_ACTION_UPDATE:
if (!helper->anything_ran) {
g_set_error (&error,
@@ -3613,7 +3605,6 @@ gs_plugin_loader_process_thread_cb (GTask *task,
case GS_PLUGIN_ACTION_URL_TO_APP:
gs_app_list_filter (list, gs_plugin_loader_app_is_valid_filter, helper);
break;
- case GS_PLUGIN_ACTION_SEARCH:
case GS_PLUGIN_ACTION_SEARCH_PROVIDES:
case GS_PLUGIN_ACTION_GET_ALTERNATES:
gs_app_list_filter (list, gs_plugin_loader_app_is_valid_filter, helper);
@@ -4065,7 +4056,6 @@ job_process_cb (GTask *task)
/* check required args */
switch (action) {
- case GS_PLUGIN_ACTION_SEARCH:
case GS_PLUGIN_ACTION_SEARCH_PROVIDES:
case GS_PLUGIN_ACTION_URL_TO_APP:
if (gs_plugin_job_get_search (plugin_job) == NULL) {
@@ -4082,12 +4072,6 @@ job_process_cb (GTask *task)
/* sorting fallbacks */
switch (action) {
- case GS_PLUGIN_ACTION_SEARCH:
- if (gs_plugin_job_get_sort_func (plugin_job, NULL) == NULL) {
- gs_plugin_job_set_sort_func (plugin_job,
- gs_utils_app_sort_match_value, NULL);
- }
- break;
case GS_PLUGIN_ACTION_GET_ALTERNATES:
if (gs_plugin_job_get_sort_func (plugin_job, NULL) == NULL) {
gs_plugin_job_set_sort_func (plugin_job,
@@ -4110,23 +4094,9 @@ job_process_cb (GTask *task)
if (plugin_loader->as_pool == NULL)
plugin_loader->as_pool = as_pool_new ();
- /* pre-tokenize search */
- if (action == GS_PLUGIN_ACTION_SEARCH) {
- const gchar *search = gs_plugin_job_get_search (plugin_job);
- helper->tokens = as_pool_build_search_tokens (plugin_loader->as_pool, search);
- if (helper->tokens == NULL) {
- g_task_return_new_error (task,
- GS_PLUGIN_ERROR,
- GS_PLUGIN_ERROR_NOT_SUPPORTED,
- "failed to tokenize %s", search);
- return;
- }
- }
-
/* set up a hang handler */
switch (action) {
case GS_PLUGIN_ACTION_GET_ALTERNATES:
- case GS_PLUGIN_ACTION_SEARCH:
case GS_PLUGIN_ACTION_SEARCH_PROVIDES:
if (gs_plugin_job_get_timeout (plugin_job) > 0) {
helper->timeout_id =
diff --git a/lib/gs-plugin-types.h b/lib/gs-plugin-types.h
index 476f3233f..99f9b76a3 100644
--- a/lib/gs-plugin-types.h
+++ b/lib/gs-plugin-types.h
@@ -265,7 +265,6 @@ typedef enum {
* @GS_PLUGIN_ACTION_UPDATE_CANCEL: Cancel the update
* @GS_PLUGIN_ACTION_GET_UPDATES: Get the list of updates
* @GS_PLUGIN_ACTION_GET_SOURCES: Get the list of sources
- * @GS_PLUGIN_ACTION_SEARCH: Get the search results for a query
* @GS_PLUGIN_ACTION_SEARCH_PROVIDES: Get the search results for a provide query
* @GS_PLUGIN_ACTION_GET_CATEGORIES: Get the list of categories
* @GS_PLUGIN_ACTION_FILE_TO_APP: Convert the file to an application
@@ -292,7 +291,6 @@ typedef enum {
GS_PLUGIN_ACTION_UPDATE_CANCEL,
GS_PLUGIN_ACTION_GET_UPDATES,
GS_PLUGIN_ACTION_GET_SOURCES,
- GS_PLUGIN_ACTION_SEARCH,
GS_PLUGIN_ACTION_SEARCH_PROVIDES,
GS_PLUGIN_ACTION_GET_CATEGORIES,
GS_PLUGIN_ACTION_FILE_TO_APP,
diff --git a/lib/gs-plugin-vfuncs.h b/lib/gs-plugin-vfuncs.h
index b71940f1b..03b091f94 100644
--- a/lib/gs-plugin-vfuncs.h
+++ b/lib/gs-plugin-vfuncs.h
@@ -63,26 +63,6 @@ GType gs_plugin_query_type (void);
void gs_plugin_adopt_app (GsPlugin *plugin,
GsApp *app);
-/**
- * gs_plugin_add_search:
- * @plugin: a #GsPlugin
- * @values: a NULL terminated list of search terms, e.g. [ "gnome", "software" ]
- * @list: a #GsAppList
- * @cancellable: a #GCancellable, or %NULL
- * @error: a #GError, or %NULL
- *
- * Get search results for a specific query.
- *
- * Plugins are expected to add new apps using gs_app_list_add().
- *
- * Returns: %TRUE for success or if not relevant
- **/
-gboolean gs_plugin_add_search (GsPlugin *plugin,
- gchar **values,
- GsAppList *list,
- GCancellable *cancellable,
- GError **error);
-
/**
* gs_plugin_add_search_what_provides
* @plugin: a list of tags, e.g. [ "text/rtf" ]
diff --git a/lib/gs-plugin.c b/lib/gs-plugin.c
index 052eca63a..68064c377 100644
--- a/lib/gs-plugin.c
+++ b/lib/gs-plugin.c
@@ -1461,8 +1461,6 @@ gs_plugin_action_to_function_name (GsPluginAction action)
return "gs_plugin_add_updates_historical";
if (action == GS_PLUGIN_ACTION_GET_UPDATES)
return "gs_plugin_add_updates";
- if (action == GS_PLUGIN_ACTION_SEARCH)
- return "gs_plugin_add_search";
if (action == GS_PLUGIN_ACTION_SEARCH_PROVIDES)
return "gs_plugin_add_search_what_provides";
if (action == GS_PLUGIN_ACTION_GET_CATEGORIES)
@@ -1507,8 +1505,6 @@ gs_plugin_action_to_string (GsPluginAction action)
return "get-updates";
if (action == GS_PLUGIN_ACTION_GET_SOURCES)
return "get-sources";
- if (action == GS_PLUGIN_ACTION_SEARCH)
- return "search";
if (action == GS_PLUGIN_ACTION_SEARCH_PROVIDES)
return "search-provides";
if (action == GS_PLUGIN_ACTION_GET_CATEGORIES)
@@ -1567,8 +1563,6 @@ gs_plugin_action_from_string (const gchar *action)
return GS_PLUGIN_ACTION_GET_UPDATES;
if (g_strcmp0 (action, "get-sources") == 0)
return GS_PLUGIN_ACTION_GET_SOURCES;
- if (g_strcmp0 (action, "search") == 0)
- return GS_PLUGIN_ACTION_SEARCH;
if (g_strcmp0 (action, "search-provides") == 0)
return GS_PLUGIN_ACTION_SEARCH_PROVIDES;
if (g_strcmp0 (action, "get-categories") == 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]