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




commit c73cff4bf3e47e7c2d461d6ed8121ec915cce6f0
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 37fb64a50..b44afa08c 100644
--- a/src/gs-page.c
+++ b/src/gs-page.c
@@ -452,10 +452,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_OPERATION_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,
@@ -480,10 +487,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]