[gnome-software/wip/async-plugin-repo-funcs: 10/26] gs-page: Replace GS_PLUGIN_ACTION_REMOVE_REPO job with manage repository job




commit 66003a74d55fc7b4e11da029f97d4c4d0deeef46
Author: Milan Crha <mcrha redhat com>
Date:   Tue Jun 14 15:19:45 2022 +0200

    gs-page: Replace GS_PLUGIN_ACTION_REMOVE_REPO job with manage repository job

 src/gs-page.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/src/gs-page.c b/src/gs-page.c
index e14da6848..4b104f075 100644
--- a/src/gs-page.c
+++ b/src/gs-page.c
@@ -448,10 +448,17 @@ gs_page_remove_app_response_cb (GtkDialog *dialog,
                return;
 
        g_debug ("uninstall %s", gs_app_get_id (helper->app));
-       plugin_job = gs_plugin_job_newv (helper->action,
-                                        "interactive", TRUE,
-                                        "app", helper->app,
-                                        NULL);
+       if (gs_app_get_kind (helper->app) == AS_COMPONENT_KIND_REPOSITORY) {
+               helper->action = GS_PLUGIN_ACTION_REMOVE_REPO;
+               plugin_job = gs_plugin_job_manage_repository_new (helper->app,
+                                                                 GS_PLUGIN_MANAGE_REPOSITORY_FLAGS_REMOVE |
+                                                                 
GS_PLUGIN_MANAGE_REPOSITORY_FLAGS_INTERACTIVE);
+       } else {
+               plugin_job = gs_plugin_job_newv (helper->action,
+                                                "interactive", TRUE,
+                                                "app", helper->app,
+                                                NULL);
+       }
        gs_plugin_loader_job_process_async (priv->plugin_loader, plugin_job,
                                            helper->cancellable,
                                            gs_page_app_removed_cb,
@@ -476,10 +483,7 @@ gs_page_remove_app (GsPage *page, GsApp *app, GCancellable *cancellable)
 
        /* pending install */
        helper = g_slice_new0 (GsPageHelper);
-       if (gs_app_get_kind (app) == AS_COMPONENT_KIND_REPOSITORY)
-               helper->action = GS_PLUGIN_ACTION_REMOVE_REPO;
-       else
-               helper->action = GS_PLUGIN_ACTION_REMOVE;
+       helper->action = GS_PLUGIN_ACTION_REMOVE;
        helper->app = g_object_ref (app);
        helper->page = g_object_ref (page);
        helper->cancellable = cancellable != NULL ? g_object_ref (cancellable) : NULL;


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