[gnome-software/wip/async-plugin-repo-funcs: 9/30] gs-page: Replace GS_PLUGIN_ACTION_INSTALL_REPO job with manage repository job
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/async-plugin-repo-funcs: 9/30] gs-page: Replace GS_PLUGIN_ACTION_INSTALL_REPO job with manage repository job
- Date: Wed, 29 Jun 2022 10:17:13 +0000 (UTC)
commit 8b4d66a2d6dc0ce3f83b9dd52659114b464ea384
Author: Milan Crha <mcrha redhat com>
Date: Tue Jun 14 12:23:36 2022 +0200
gs-page: Replace GS_PLUGIN_ACTION_INSTALL_REPO job with manage repository job
src/gs-page.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/src/gs-page.c b/src/gs-page.c
index 71e929612..e14da6848 100644
--- a/src/gs-page.c
+++ b/src/gs-page.c
@@ -278,21 +278,28 @@ gs_page_install_app (GsPage *page,
}
helper = g_slice_new0 (GsPageHelper);
- if (gs_app_get_kind (app) == AS_COMPONENT_KIND_REPOSITORY)
- helper->action = GS_PLUGIN_ACTION_INSTALL_REPO;
- else
- helper->action = GS_PLUGIN_ACTION_INSTALL;
helper->app = g_object_ref (app);
helper->page = g_object_ref (page);
helper->cancellable = g_object_ref (cancellable);
helper->interaction = interaction;
helper->propagate_error = TRUE;
- plugin_job = gs_plugin_job_newv (helper->action,
- "interactive", (interaction == GS_SHELL_INTERACTION_FULL),
- "propagate-error", helper->propagate_error,
- "app", helper->app,
- NULL);
+ if (gs_app_get_kind (app) == AS_COMPONENT_KIND_REPOSITORY) {
+ helper->action = GS_PLUGIN_ACTION_INSTALL_REPO;
+ plugin_job = gs_plugin_job_manage_repository_new (helper->app,
+ GS_PLUGIN_MANAGE_REPOSITORY_FLAGS_INSTALL |
+ ((interaction == GS_SHELL_INTERACTION_FULL)
?
+
GS_PLUGIN_MANAGE_REPOSITORY_FLAGS_INTERACTIVE : 0));
+ gs_plugin_job_set_propagate_error (plugin_job, helper->propagate_error);
+ } else {
+ helper->action = GS_PLUGIN_ACTION_INSTALL;
+ plugin_job = gs_plugin_job_newv (helper->action,
+ "interactive", (interaction == GS_SHELL_INTERACTION_FULL),
+ "propagate-error", helper->propagate_error,
+ "app", helper->app,
+ NULL);
+ }
+
gs_plugin_loader_job_process_async (priv->plugin_loader,
plugin_job,
helper->cancellable,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]