[gnome-software: 50/72] gs-plugin-job-refine: Add a wrapper function for creating a refine job




commit ca0adb5e1968cb33953c3c645bd1b736c0a1602b
Author: Philip Withnall <pwithnall endlessos org>
Date:   Mon Nov 22 17:34:02 2021 +0000

    gs-plugin-job-refine: Add a wrapper function for creating a refine job
    
    This will eventually become a full subclass of `GsPluginJob`, but for
    now, just do a trivial port of all the places which create a refine job.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 lib/gnome-software.h         |  1 +
 lib/gs-cmd.c                 |  5 +----
 lib/gs-plugin-job-refine.c   | 53 ++++++++++++++++++++++++++++++++++++++++++++
 lib/gs-plugin-job-refine.h   | 24 ++++++++++++++++++++
 lib/gs-plugin-loader.c       | 14 ++++--------
 lib/meson.build              |  2 ++
 plugins/core/gs-self-test.c  | 18 +++++----------
 plugins/dummy/gs-self-test.c | 30 +++++++------------------
 plugins/repos/gs-self-test.c |  5 +----
 src/gs-details-page.c        | 29 +++++++++---------------
 src/gs-moderate-page.c       | 20 ++++++++---------
 src/gs-updates-page.c        |  7 ++----
 12 files changed, 121 insertions(+), 87 deletions(-)
---
diff --git a/lib/gnome-software.h b/lib/gnome-software.h
index 0994dbdf9..b16d25072 100644
--- a/lib/gnome-software.h
+++ b/lib/gnome-software.h
@@ -26,6 +26,7 @@
 #include <gs-plugin.h>
 #include <gs-plugin-helpers.h>
 #include <gs-plugin-job.h>
+#include <gs-plugin-job-refine.h>
 #include <gs-plugin-vfuncs.h>
 #include <gs-remote-icon.h>
 #include <gs-utils.h>
diff --git a/lib/gs-cmd.c b/lib/gs-cmd.c
index 9adb5ff43..1c4eaeb2d 100644
--- a/lib/gs-cmd.c
+++ b/lib/gs-cmd.c
@@ -465,10 +465,7 @@ main (int argc, char **argv)
                app = gs_app_new (argv[2]);
                for (i = 0; i < repeat; i++) {
                        g_autoptr(GsPluginJob) plugin_job = NULL;
-                       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                                        "app", app,
-                                                        "refine-flags", self->refine_flags,
-                                                        NULL);
+                       plugin_job = gs_plugin_job_refine_new_for_app (app, self->refine_flags);
                        ret = gs_plugin_loader_job_action (self->plugin_loader, plugin_job,
                                                            NULL, &error);
                        if (!ret)
diff --git a/lib/gs-plugin-job-refine.c b/lib/gs-plugin-job-refine.c
new file mode 100644
index 000000000..a12e27e8b
--- /dev/null
+++ b/lib/gs-plugin-job-refine.c
@@ -0,0 +1,53 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ * vi:set noexpandtab tabstop=8 shiftwidth=8:
+ *
+ * Copyright (C) 2021 Endless OS Foundation LLC
+ *
+ * Author: Philip Withnall <pwithnall endlessos org>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include "config.h"
+
+#include <glib.h>
+
+/**
+ * gs_plugin_job_refine_new:
+ * @app_list: the list of #GsApps to refine
+ * @flags: flags to affect what is refined
+ *
+ * Create a new #GsPluginJob for refining the given @app_list.
+ *
+ * Returns: (transfer full): a new #GsPluginJob
+ * Since: 42
+ */
+GsPluginJob *
+gs_plugin_job_refine_new (GsAppList           *app_list,
+                          GsPluginRefineFlags  flags)
+{
+       return gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
+                                  "list", app_list,
+                                  "refine-flags", flags,
+                                  NULL);
+}
+
+/**
+ * gs_plugin_job_refine_new_for_app:
+ * @app: the #GsApp to refine
+ * @flags: flags to affect what is refined
+ *
+ * Create a new #GsPluginJob for refining the given @app.
+ *
+ * Returns: (transfer full): a new #GsPluginJob
+ * Since: 42
+ */
+GsPluginJob *
+gs_plugin_job_refine_new_for_app (GsApp               *app,
+                                  GsPluginRefineFlags  flags)
+{
+       return gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
+                                  "app", app,
+                                  "refine-flags", flags,
+                                  NULL);
+}
diff --git a/lib/gs-plugin-job-refine.h b/lib/gs-plugin-job-refine.h
new file mode 100644
index 000000000..8b1491b31
--- /dev/null
+++ b/lib/gs-plugin-job-refine.h
@@ -0,0 +1,24 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ * vi:set noexpandtab tabstop=8 shiftwidth=8:
+ *
+ * Copyright (C) 2021 Endless OS Foundation LLC
+ *
+ * Author: Philip Withnall <pwithnall endlessos org>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#pragma once
+
+#include <glib.h>
+
+#include "gs-plugin-job.h"
+
+G_BEGIN_DECLS
+
+GsPluginJob    *gs_plugin_job_refine_new_for_app       (GsApp               *app,
+                                                        GsPluginRefineFlags  flags);
+GsPluginJob    *gs_plugin_job_refine_new               (GsAppList           *app_list,
+                                                        GsPluginRefineFlags  flags);
+
+G_END_DECLS
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index 8148316cb..b3ee747d4 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -1065,10 +1065,7 @@ gs_plugin_loader_run_refine (GsPluginLoaderHelper *helper,
        }
 
        /* first pass */
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                        "list", list,
-                                        "refine-flags", gs_plugin_job_get_refine_flags (helper->plugin_job),
-                                        NULL);
+       plugin_job = gs_plugin_job_refine_new (list, gs_plugin_job_get_refine_flags (helper->plugin_job));
        helper2 = gs_plugin_loader_helper_new (helper->plugin_loader, plugin_job);
        helper2->function_name_parent = helper->function_name;
        ret = gs_plugin_loader_run_refine_internal (helper2, list, cancellable, error);
@@ -1829,7 +1826,7 @@ load_install_queue (GsPluginLoader *plugin_loader, GError **error)
        if (gs_app_list_length (list) > 0) {
                g_autoptr(GsPluginLoaderHelper) helper = NULL;
                g_autoptr(GsPluginJob) plugin_job = NULL;
-               plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE, NULL);
+               plugin_job = gs_plugin_job_refine_new (NULL, GS_PLUGIN_REFINE_FLAGS_REQUIRE_ID);
                helper = gs_plugin_loader_helper_new (plugin_loader, plugin_job);
                if (!gs_plugin_loader_run_refine (helper, list, NULL, error))
                        return FALSE;
@@ -3548,10 +3545,7 @@ gs_plugin_loader_process_thread_cb (GTask *task,
        if (filter_flags > 0 && max_results > 0 && sort_func != NULL) {
                g_autoptr(GsPluginLoaderHelper) helper2 = NULL;
                g_autoptr(GsPluginJob) plugin_job = NULL;
-               plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                                "list", list,
-                                                "refine-flags", filter_flags,
-                                                NULL);
+               plugin_job = gs_plugin_job_refine_new (list, filter_flags);
                helper2 = gs_plugin_loader_helper_new (helper->plugin_loader, plugin_job);
                helper2->function_name_parent = helper->function_name;
                g_debug ("running filter flags with early refine");
@@ -4133,7 +4127,7 @@ gs_plugin_loader_job_app_create_thread_cb (GTask *task,
        gs_app_add_quirk (app, GS_APP_QUIRK_IS_WILDCARD);
        gs_app_set_from_unique_id (app, unique_id, AS_COMPONENT_KIND_UNKNOWN);
        gs_app_list_add (list, app);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE, NULL);
+       plugin_job = gs_plugin_job_refine_new (NULL, GS_PLUGIN_REFINE_FLAGS_REQUIRE_ID);
        helper = gs_plugin_loader_helper_new (plugin_loader, plugin_job);
        if (!gs_plugin_loader_run_refine (helper, list, NULL, &error)) {
                g_prefix_error (&error, "Failed to refine '%s': ", unique_id);
diff --git a/lib/meson.build b/lib/meson.build
index d55407685..cbee2e82c 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -21,6 +21,7 @@ libgnomesoftware_public_headers = [
   'gs-plugin-event.h',
   'gs-plugin-helpers.h',
   'gs-plugin-job.h',
+  'gs-plugin-job-refine.h',
   'gs-plugin-loader.h',
   'gs-plugin-loader-sync.h',
   'gs-plugin-types.h',
@@ -95,6 +96,7 @@ libgnomesoftware = library(
     'gs-plugin-event.c',
     'gs-plugin-helpers.c',
     'gs-plugin-job.c',
+    'gs-plugin-job-refine.c',
     'gs-plugin-loader.c',
     'gs-plugin-loader-sync.c',
     'gs-remote-icon.c',
diff --git a/plugins/core/gs-self-test.c b/plugins/core/gs-self-test.c
index e6536bb76..0064766d3 100644
--- a/plugins/core/gs-self-test.c
+++ b/plugins/core/gs-self-test.c
@@ -68,11 +68,9 @@ gs_plugins_core_os_release_func (GsPluginLoader *plugin_loader)
        app = gs_plugin_loader_get_system_app (plugin_loader, NULL, &error);
        g_assert_no_error (error);
        g_assert_nonnull (app);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                        "app", app,
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_URL |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION,
-                                        NULL);
+       plugin_job = gs_plugin_job_refine_new_for_app (app,
+                                                      GS_PLUGIN_REFINE_FLAGS_REQUIRE_URL |
+                                                      GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -136,10 +134,7 @@ gs_plugins_core_generic_updates_func (GsPluginLoader *plugin_loader)
        gs_app_list_add (list, app2);
 
        /* refine to make the generic-updates plugin merge them into a single OsUpdate item */
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                        "list", list,
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_UPDATE_DETAILS,
-                                        NULL);
+       plugin_job = gs_plugin_job_refine_new (list, GS_PLUGIN_REFINE_FLAGS_REQUIRE_UPDATE_DETAILS);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -165,10 +160,7 @@ gs_plugins_core_generic_updates_func (GsPluginLoader *plugin_loader)
        gs_app_add_quirk (app_wildcard, GS_APP_QUIRK_IS_WILDCARD);
        gs_app_set_kind (app_wildcard, AS_COMPONENT_KIND_GENERIC);
        gs_app_list_add (list_wildcard, app_wildcard);
-       plugin_job2 = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                         "list", list_wildcard,
-                                         "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_UPDATE_DETAILS,
-                                         NULL);
+       plugin_job2 = gs_plugin_job_refine_new (list_wildcard, GS_PLUGIN_REFINE_FLAGS_REQUIRE_UPDATE_DETAILS);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job2, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
diff --git a/plugins/dummy/gs-self-test.c b/plugins/dummy/gs-self-test.c
index 509622427..ca6cd123b 100644
--- a/plugins/dummy/gs-self-test.c
+++ b/plugins/dummy/gs-self-test.c
@@ -143,12 +143,10 @@ gs_plugins_dummy_refine_func (GsPluginLoader *plugin_loader)
        app = gs_app_new ("chiron.desktop");
        plugin = gs_plugin_loader_find_plugin (plugin_loader, "dummy");
        gs_app_set_management_plugin (app, plugin);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                        "app", app,
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_URL,
-                                        NULL);
+       plugin_job = gs_plugin_job_refine_new_for_app (app,
+                                                      GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION |
+                                                      GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE |
+                                                      GS_PLUGIN_REFINE_FLAGS_REQUIRE_URL);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -172,10 +170,7 @@ gs_plugins_dummy_metadata_quirks (GsPluginLoader *plugin_loader)
        app = gs_app_new ("chiron.desktop");
        plugin = gs_plugin_loader_find_plugin (plugin_loader, "dummy");
        gs_app_set_management_plugin (app, plugin);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                        "app", app,
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION,
-                                        NULL);
+       plugin_job = gs_plugin_job_refine_new_for_app (app, GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -190,10 +185,7 @@ gs_plugins_dummy_metadata_quirks (GsPluginLoader *plugin_loader)
        gs_app_set_metadata (app, "GnomeSoftware::quirks::not-launchable", "true");
 
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                        "app", app,
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION,
-                                        NULL);
+       plugin_job = gs_plugin_job_refine_new_for_app (app, GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -205,10 +197,7 @@ gs_plugins_dummy_metadata_quirks (GsPluginLoader *plugin_loader)
        gs_app_set_metadata (app, "GnomeSoftware::quirks::not-launchable", "false");
 
        g_object_unref (plugin_job);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                        "app", app,
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION,
-                                        NULL);
+       plugin_job = gs_plugin_job_refine_new_for_app (app, GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
@@ -229,10 +218,7 @@ gs_plugins_dummy_key_colors_func (GsPluginLoader *plugin_loader)
 
        /* get the extra bits */
        app = gs_app_new ("chiron.desktop");
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                        "app", app,
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
-                                        NULL);
+       plugin_job = gs_plugin_job_refine_new_for_app (app, GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
diff --git a/plugins/repos/gs-self-test.c b/plugins/repos/gs-self-test.c
index 259d0fb64..c7b44bbe1 100644
--- a/plugins/repos/gs-self-test.c
+++ b/plugins/repos/gs-self-test.c
@@ -24,10 +24,7 @@ gs_plugins_repos_func (GsPluginLoader *plugin_loader)
        app = gs_app_new ("testrepos.desktop");
        gs_app_set_origin (app, "utopia");
        gs_app_set_bundle_kind (app, AS_BUNDLE_KIND_PACKAGE);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                        "app", app,
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME,
-                                        NULL);
+       plugin_job = gs_plugin_job_refine_new_for_app (app, GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME);
        ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();
        g_assert_no_error (error);
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index 5d82881bb..44c2b7689 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -769,13 +769,11 @@ gs_details_page_get_alternates_cb (GObject *source_object,
                g_autoptr(GsPluginJob) plugin_job = NULL;
 
                /* Make sure the changed instance contains the reviews and such */
-               plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                                "app", self->app,
-                                                "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
-                                                                
GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS |
-                                                                GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS |
-                                                                GS_PLUGIN_REFINE_FLAGS_REQUIRE_SIZE,
-                                                NULL);
+               plugin_job = gs_plugin_job_refine_new_for_app (self->app,
+                                                              GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
+                                                              GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS |
+                                                              GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS |
+                                                              GS_PLUGIN_REFINE_FLAGS_REQUIRE_SIZE);
                gs_plugin_loader_job_process_async (self->plugin_loader, plugin_job,
                                                    self->cancellable,
                                                    gs_details_page_app_refine_cb,
@@ -1537,13 +1535,11 @@ gs_details_page_load_stage2 (GsDetailsPage *self,
 
        /* if these tasks fail (e.g. because we have no networking) then it's
         * of no huge importance if we don't get the required data */
-       plugin_job1 = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                         "app", self->app,
-                                         "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
-                                                         GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS |
-                                                         GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS |
-                                                         GS_PLUGIN_REFINE_FLAGS_REQUIRE_SIZE,
-                                         NULL);
+       plugin_job1 = gs_plugin_job_refine_new_for_app (self->app,
+                                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
+                                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS |
+                                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS |
+                                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_SIZE);
        plugin_job2 = gs_plugin_job_newv (GS_PLUGIN_ACTION_GET_ALTERNATES,
                                          "interactive", TRUE,
                                          "app", self->app,
@@ -1702,10 +1698,7 @@ gs_details_page_load_stage1 (GsDetailsPage *self)
        gs_details_page_set_state (self, GS_DETAILS_PAGE_STATE_LOADING);
 
        /* get extra details about the app */
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                        "app", self->app,
-                                        "refine-flags", GS_DETAILS_PAGE_REFINE_FLAGS,
-                                        NULL);
+       plugin_job = gs_plugin_job_refine_new_for_app (self->app, GS_DETAILS_PAGE_REFINE_FLAGS);
        gs_plugin_loader_job_process_async (self->plugin_loader, plugin_job,
                                            self->cancellable,
                                            gs_details_page_load_stage1_cb,
diff --git a/src/gs-moderate-page.c b/src/gs-moderate-page.c
index f59ec21b4..b1ad167d4 100644
--- a/src/gs-moderate-page.c
+++ b/src/gs-moderate-page.c
@@ -243,17 +243,15 @@ gs_moderate_page_load (GsModeratePage *self)
                return;
        }
 
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                        "list", list,
-                                        "interactive", TRUE,
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROVENANCE |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS,
-                                        NULL);
+       plugin_job = gs_plugin_job_refine_new (list,
+                                              GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
+                                              GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION |
+                                              GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION |
+                                              GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROVENANCE |
+                                              GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION |
+                                              GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE |
+                                              GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS);
+       gs_plugin_job_set_interactive (plugin_job, TRUE);
        gs_plugin_loader_job_process_async (self->plugin_loader, plugin_job,
                                            self->cancellable,
                                            gs_moderate_page_refine_unvoted_reviews_cb,
diff --git a/src/gs-updates-page.c b/src/gs-updates-page.c
index 339568a75..686ec740c 100644
--- a/src/gs-updates-page.c
+++ b/src/gs-updates-page.c
@@ -618,11 +618,8 @@ gs_updates_page_get_system_finished_cb (GObject *source_object,
                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION;
 
        helper = gs_page_helper_new (self, app);
-       plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
-                                        "interactive", TRUE,
-                                        "app", app,
-                                        "refine-flags", refine_flags,
-                                        NULL);
+       plugin_job = gs_plugin_job_refine_new_for_app (app, refine_flags);
+       gs_plugin_job_set_interactive (plugin_job, TRUE);
        gs_plugin_loader_job_process_async (self->plugin_loader, plugin_job,
                                            self->cancellable,
                                            gs_updates_page_refine_system_finished_cb,


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