[gnome-software] Fix WhatProvides package search



commit 0d2d8ad8c367c4d321173ec76c93b0ff8d546a7d
Author: Iain Lane <iain orangesquash org uk>
Date:   Wed Jun 7 17:07:06 2017 +0100

    Fix WhatProvides package search
    
    When searching WhatProvides, we need to pass the data given to us
    directly onwards to PackageKit.

 lib/gs-plugin-loader.c |   11 +++++++++--
 src/gs-extras-page.c   |    2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index b151a3b..cd84b84 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -607,8 +607,6 @@ gs_plugin_loader_call_vfunc (GsPluginLoaderHelper *helper,
                }
                break;
        case GS_PLUGIN_ACTION_SEARCH:
-       case GS_PLUGIN_ACTION_SEARCH_FILES:
-       case GS_PLUGIN_ACTION_SEARCH_PROVIDES:
                {
                        GsPluginSearchFunc plugin_func = func;
                        g_auto(GStrv) tokens = NULL;
@@ -617,6 +615,15 @@ gs_plugin_loader_call_vfunc (GsPluginLoaderHelper *helper,
                                           cancellable, &error_local);
                }
                break;
+       case GS_PLUGIN_ACTION_SEARCH_FILES:
+       case GS_PLUGIN_ACTION_SEARCH_PROVIDES:
+               {
+                       GsPluginSearchFunc plugin_func = func;
+                       gchar *search[2] = { gs_plugin_job_get_search (helper->plugin_job), NULL };
+                       ret = plugin_func (plugin, search, list,
+                                          cancellable, &error_local);
+               }
+               break;
        case GS_PLUGIN_ACTION_GET_CATEGORIES:
                {
                        GsPluginCategoriesFunc plugin_func = func;
diff --git a/src/gs-extras-page.c b/src/gs-extras-page.c
index e81c5fc..c514e4d 100644
--- a/src/gs-extras-page.c
+++ b/src/gs-extras-page.c
@@ -722,7 +722,7 @@ gs_extras_page_load (GsExtrasPage *self, GPtrArray *array_search_data)
                        g_autoptr(GsPluginJob) plugin_job = NULL;
                        g_debug ("searching what provides: '%s'", search_data->search);
                        plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH_PROVIDES,
-                                                        "search", search_data->search_filename,
+                                                        "search", search_data->search,
                                                         "failure-flags", GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
                                                         "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
                                                                         
GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION |


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