[gnome-software: 10/20] tests: Port ACTION_SEARCH to use GsPluginJobListApps




commit fd1150b904344743f86bad15d140f709966ed16c
Author: Philip Withnall <pwithnall endlessos org>
Date:   Fri Jul 1 18:07:15 2022 +0100

    tests: Port ACTION_SEARCH to use GsPluginJobListApps
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #1472

 plugins/core/gs-self-test.c     |  17 +++--
 plugins/dummy/gs-self-test.c    |  36 +++++++----
 plugins/flatpak/gs-self-test.c  | 139 ++++++++++++++++++++++++++++------------
 plugins/modalias/gs-self-test.c |  12 ++--
 plugins/snap/gs-self-test.c     |  13 ++--
 5 files changed, 148 insertions(+), 69 deletions(-)
---
diff --git a/plugins/core/gs-self-test.c b/plugins/core/gs-self-test.c
index 260066b38..d87ea87b5 100644
--- a/plugins/core/gs-self-test.c
+++ b/plugins/core/gs-self-test.c
@@ -31,6 +31,8 @@ gs_plugins_core_search_repo_name_func (GsPluginLoader *plugin_loader)
        g_autoptr(GsApp) app_tmp = NULL;
        g_autoptr(GsAppList) list = NULL;
        g_autoptr(GsPluginJob) plugin_job = NULL;
+       g_autoptr(GsAppQuery) query = NULL;
+       const gchar *keywords[2] = { NULL, };
 
        /* drop all caches */
        gs_utils_rmtree (g_getenv ("GS_SELF_TEST_CACHEDIR"), NULL);
@@ -43,17 +45,20 @@ gs_plugins_core_search_repo_name_func (GsPluginLoader *plugin_loader)
        gs_app_set_state (app_tmp, GS_APP_STATE_INSTALLED);
 
        /* get search result based on addon keyword */
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH,
-                                        "search", "yellow",
-                                        NULL);
-       gs_plugin_job_set_refine_flags (plugin_job, GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON);
+       keywords[0] = "yellow";
+       query = gs_app_query_new ("keywords", keywords,
+                                 "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+                                 "dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+                                 NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
+
        list = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
        g_assert_nonnull (list);
 
-       /* make sure there is one entry, the parent app */
-       g_assert_cmpint (gs_app_list_length (list), ==, 1);
+       /* make sure there is at least one entry, the parent app */
+       g_assert_cmpint (gs_app_list_length (list), >=, 1);
        app = gs_app_list_index (list, 0);
        g_assert_cmpstr (gs_app_get_id (app), ==, "arachne.desktop");
        g_assert_cmpint (gs_app_get_kind (app), ==, AS_COMPONENT_KIND_DESKTOP_APP);
diff --git a/plugins/dummy/gs-self-test.c b/plugins/dummy/gs-self-test.c
index e15a9815e..3ffe925ee 100644
--- a/plugins/dummy/gs-self-test.c
+++ b/plugins/dummy/gs-self-test.c
@@ -439,19 +439,24 @@ gs_plugins_dummy_search_func (GsPluginLoader *plugin_loader)
        g_autoptr(GError) error = NULL;
        g_autoptr(GsAppList) list = NULL;
        g_autoptr(GsPluginJob) plugin_job = NULL;
+       g_autoptr(GsAppQuery) query = NULL;
+       const gchar *keywords[2] = { NULL, };
 
        /* get search result based on addon keyword */
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH,
-                                        "search", "zeus",
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
-                                        NULL);
+       keywords[0] = "zeus";
+       query = gs_app_query_new ("keywords", keywords,
+                                 "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+                                 "dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+                                 "sort-func", gs_utils_app_sort_match_value,
+                                 NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
        list = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
        g_assert (list != NULL);
 
-       /* make sure there is one entry, the parent app */
-       g_assert_cmpint (gs_app_list_length (list), ==, 1);
+       /* make sure there is at least one entry, the parent app, which must be first */
+       g_assert_cmpint (gs_app_list_length (list), >=, 1);
        app = gs_app_list_index (list, 0);
        g_assert_cmpstr (gs_app_get_id (app), ==, "zeus.desktop");
        g_assert_cmpint (gs_app_get_kind (app), ==, AS_COMPONENT_KIND_DESKTOP_APP);
@@ -494,16 +499,17 @@ gs_plugins_dummy_hang_func (GsPluginLoader *plugin_loader)
        g_autoptr(GError) error = NULL;
        g_autoptr(GsAppList) list = NULL;
        g_autoptr(GsPluginJob) plugin_job = NULL;
+       g_autoptr(GsAppQuery) query = NULL;
+       const gchar *keywords[2] = { NULL, };
 
        /* drop all caches */
        gs_utils_rmtree (g_getenv ("GS_SELF_TEST_CACHEDIR"), NULL);
        gs_test_reinitialise_plugin_loader (plugin_loader, allowlist, NULL);
 
        /* get search result based on addon keyword */
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH,
-                                        "search", "hang",
-                                        "timeout", 1, /* seconds */
-                                        NULL);
+       keywords[0] = "hang";
+       query = gs_app_query_new ("keywords", keywords, NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
        list = gs_plugin_loader_job_process (plugin_loader, plugin_job, cancellable, &error);
        gs_test_flush_main_context ();
        g_assert_error (error, GS_PLUGIN_ERROR, GS_PLUGIN_ERROR_TIMED_OUT);
@@ -516,11 +522,15 @@ gs_plugins_dummy_search_invalid_func (GsPluginLoader *plugin_loader)
        g_autoptr(GError) error = NULL;
        g_autoptr(GsAppList) list = NULL;
        g_autoptr(GsPluginJob) plugin_job = NULL;
+       g_autoptr(GsAppQuery) query = NULL;
+       const gchar *keywords[2] = { NULL, };
 
        /* get search result based on addon keyword */
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH,
-                                        "search", "X",
-                                        NULL);
+       keywords[0] = "X";
+       query = gs_app_query_new ("keywords", keywords,
+                                 "dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+                                 NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
        list = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_error (error, GS_PLUGIN_ERROR, GS_PLUGIN_ERROR_NOT_SUPPORTED);
diff --git a/plugins/flatpak/gs-self-test.c b/plugins/flatpak/gs-self-test.c
index c6fdf3f9f..dd338c2b2 100644
--- a/plugins/flatpak/gs-self-test.c
+++ b/plugins/flatpak/gs-self-test.c
@@ -270,6 +270,8 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
        gulong signal_id;
        gboolean seen_unknown;
        GsPlugin *plugin;
+       g_autoptr(GsAppQuery) query = NULL;
+       const gchar *keywords[2] = { NULL, };
 
        /* drop all caches */
        gs_utils_rmtree (g_getenv ("GS_SELF_TEST_CACHEDIR"), NULL);
@@ -348,10 +350,15 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
 
        /* all the apps should have the flatpak keyword */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH,
-                                        "search", "flatpak",
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
-                                        NULL);
+
+       keywords[0] = "flatpak";
+       query = gs_app_query_new ("keywords", keywords,
+                                 "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+                                 "dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+                                 NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
+       g_clear_object (&query);
+
        list_all = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        g_assert_no_error (error);
        g_assert_true (list_all != NULL);
@@ -359,15 +366,20 @@ gs_plugins_flatpak_app_with_runtime_func (GsPluginLoader *plugin_loader)
 
        /* find available application */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH,
-                                        "search", "Bingo",
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_KUDOS |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
-                                        NULL);
+
+       keywords[0] = "Bingo";
+       query = gs_app_query_new ("keywords", keywords,
+                                 "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME |
+                                                 GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS |
+                                                 GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION |
+                                                 GS_PLUGIN_REFINE_FLAGS_REQUIRE_KUDOS |
+                                                 GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME |
+                                                 GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+                                 "dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+                                 NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
+       g_clear_object (&query);
+
        list = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        g_assert_no_error (error);
        g_assert_true (list != NULL);
@@ -543,6 +555,8 @@ gs_plugins_flatpak_app_missing_runtime_func (GsPluginLoader *plugin_loader)
        g_autoptr(GsAppList) list = NULL;
        g_autoptr(GsPluginJob) plugin_job = NULL;
        GsPlugin *plugin;
+       g_autoptr(GsAppQuery) query = NULL;
+       const gchar *keywords[2] = { NULL, };
 
        /* drop all caches */
        gs_utils_rmtree (g_getenv ("GS_SELF_TEST_CACHEDIR"), NULL);
@@ -588,10 +602,15 @@ gs_plugins_flatpak_app_missing_runtime_func (GsPluginLoader *plugin_loader)
 
        /* find available application */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH,
-                                        "search", "Bingo",
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
-                                        NULL);
+
+       keywords[0] = "Bingo";
+       query = gs_app_query_new ("keywords", keywords,
+                                 "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+                                 "dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+                                 NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
+       g_clear_object (&query);
+
        list = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -1064,6 +1083,8 @@ flatpak_bundle_or_ref_helper (GsPluginLoader *plugin_loader,
        g_autoptr(GsAppList) sources = NULL;
        g_autoptr(GsPluginJob) plugin_job = NULL;
        GsPlugin *plugin;
+       g_autoptr(GsAppQuery) query = NULL;
+       const gchar *keywords[2] = { NULL, };
 
        /* drop all caches */
        gs_utils_rmtree (g_getenv ("GS_SELF_TEST_CACHEDIR"), NULL);
@@ -1100,10 +1121,15 @@ flatpak_bundle_or_ref_helper (GsPluginLoader *plugin_loader,
 
        /* find available application */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH,
-                                        "search", "runtime",
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
-                                        NULL);
+
+       keywords[0] = "runtime";
+       query = gs_app_query_new ("keywords", keywords,
+                                 "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+                                 "dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+                                 NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
+       g_clear_object (&query);
+
        list = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        g_assert_no_error (error);
        g_assert_true (list != NULL);
@@ -1217,10 +1243,15 @@ flatpak_bundle_or_ref_helper (GsPluginLoader *plugin_loader,
 
        /* search for the application */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH,
-                                        "search", "chiron",
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
-                                        NULL);
+
+       keywords[0] = "chiron";
+       query = gs_app_query_new ("keywords", keywords,
+                                 "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+                                 "dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+                                 NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
+       g_clear_object (&query);
+
        search1 = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -1300,10 +1331,15 @@ flatpak_bundle_or_ref_helper (GsPluginLoader *plugin_loader,
 
        /* there should be no matches now */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH,
-                                        "search", "chiron",
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
-                                        NULL);
+
+       keywords[0] = "chiron";
+       query = gs_app_query_new ("keywords", keywords,
+                                 "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+                                 "dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+                                 NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
+       g_clear_object (&query);
+
        search2 = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -1357,6 +1393,8 @@ gs_plugins_flatpak_app_update_func (GsPluginLoader *plugin_loader)
        g_autofree gchar *repo_path = NULL;
        g_autofree gchar *repo_url = NULL;
        GsPlugin *plugin;
+       g_autoptr(GsAppQuery) query = NULL;
+       const gchar *keywords[2] = { NULL, };
 
        /* drop all caches */
        gs_utils_rmtree (g_getenv ("GS_SELF_TEST_CACHEDIR"), NULL);
@@ -1411,11 +1449,16 @@ gs_plugins_flatpak_app_update_func (GsPluginLoader *plugin_loader)
 
        /* find available application */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH,
-                                        "search", "Bingo",
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME,
-                                        NULL);
+
+       keywords[0] = "Bingo";
+       query = gs_app_query_new ("keywords", keywords,
+                                 "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
+                                                 GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME,
+                                 "dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+                                 NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
+       g_clear_object (&query);
+
        list = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -1606,6 +1649,8 @@ gs_plugins_flatpak_runtime_extension_func (GsPluginLoader *plugin_loader)
        g_autofree gchar *repo_path = NULL;
        g_autofree gchar *repo_url = NULL;
        GsPlugin *plugin;
+       g_autoptr(GsAppQuery) query = NULL;
+       const gchar *keywords[2] = { NULL, };
 
        /* drop all caches */
        gs_utils_rmtree (g_getenv ("GS_SELF_TEST_CACHEDIR"), NULL);
@@ -1658,10 +1703,15 @@ gs_plugins_flatpak_runtime_extension_func (GsPluginLoader *plugin_loader)
 
        /* find available application */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH,
-                                        "search", "Bingo",
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
-                                        NULL);
+
+       keywords[0] = "Bingo";
+       query = gs_app_query_new ("keywords", keywords,
+                                 "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+                                 "dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+                                 NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
+       g_clear_object (&query);
+
        list = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -1788,10 +1838,15 @@ gs_plugins_flatpak_runtime_extension_func (GsPluginLoader *plugin_loader)
        g_clear_object (&list);
        /* Reload the 'app', as it could change due to repo change */
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH,
-                                        "search", "Bingo",
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME,
-                                        NULL);
+
+       keywords[0] = "Bingo";
+       query = gs_app_query_new ("keywords", keywords,
+                                 "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME,
+                                 "dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+                                 NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
+       g_clear_object (&query);
+
        list = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
diff --git a/plugins/modalias/gs-self-test.c b/plugins/modalias/gs-self-test.c
index 7ab8bb0be..d0d6d8c4e 100644
--- a/plugins/modalias/gs-self-test.c
+++ b/plugins/modalias/gs-self-test.c
@@ -18,13 +18,17 @@ gs_plugins_modalias_func (GsPluginLoader *plugin_loader)
        GsApp *app;
        g_autoptr(GError) error = NULL;
        g_autoptr(GsAppList) list = NULL;
+       g_autoptr(GsAppQuery) query = NULL;
+       const gchar *keywords[2] = { NULL, };
        g_autoptr(GsPluginJob) plugin_job = NULL;
 
        /* get search result based on addon keyword */
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH,
-                                        "search", "colorhug2",
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_CATEGORIES,
-                                        NULL);
+       keywords[0] = "colorhug2";
+       query = gs_app_query_new ("keywords", keywords,
+                                 "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_CATEGORIES,
+                                 "dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+                                 NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
        list = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
diff --git a/plugins/snap/gs-self-test.c b/plugins/snap/gs-self-test.c
index 1f38b16e0..a2fd4f6d6 100644
--- a/plugins/snap/gs-self-test.c
+++ b/plugins/snap/gs-self-test.c
@@ -267,6 +267,8 @@ gs_plugins_snap_test_func (GsPluginLoader *plugin_loader)
        g_autoptr(GError) error = NULL;
        GsSizeType size_installed_type, size_download_type;
        guint64 size_installed_bytes, size_download_bytes;
+       const gchar *keywords[] = { NULL, };
+       g_autoptr(GsAppQuery) query = NULL;
 
        /* no snap, abort */
        if (!gs_plugin_loader_get_enabled (plugin_loader, "snap")) {
@@ -274,10 +276,13 @@ gs_plugins_snap_test_func (GsPluginLoader *plugin_loader)
                return;
        }
 
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH,
-                                        "search", "snap",
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON | 
GS_PLUGIN_REFINE_FLAGS_REQUIRE_SCREENSHOTS,
-                                        NULL);
+       keywords[0] = "snap";
+       query = gs_app_query_new ("keywords", keywords,
+                                 "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
+                                                 GS_PLUGIN_REFINE_FLAGS_REQUIRE_SCREENSHOTS,
+                                 "dedupe-flags", GS_PLUGIN_JOB_DEDUPE_FLAGS_DEFAULT,
+                                 NULL);
+       plugin_job = gs_plugin_job_list_apps_new (query, GS_PLUGIN_LIST_APPS_FLAGS_NONE);
        apps = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        g_assert_no_error (error);
        g_assert (apps != NULL);


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