[gnome-software: 1/2] gs-page: Prevent removing compulsory apps




commit 033646a39df925c9950faaf7e8314855a2a278bc
Author: Philip Withnall <pwithnall endlessos org>
Date:   Wed Jun 8 12:50:48 2022 +0100

    gs-page: Prevent removing compulsory apps
    
    This makes the following command just open the details page for
    gnome-software, rather than going ahead and trying to uninstall it:
    ```sh
    gnome-software --uninstall=system/package/fedora/org.gnome.Software.desktop/*
    ```
    
    Spotted in
    https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/1389#note_1474003.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 src/gs-page.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/gs-page.c b/src/gs-page.c
index 4ba414b3d..71e929612 100644
--- a/src/gs-page.c
+++ b/src/gs-page.c
@@ -463,6 +463,10 @@ gs_page_remove_app (GsPage *page, GsApp *app, GCancellable *cancellable)
        GtkWidget *remove_button;
        GtkStyleContext *context;
 
+       /* Is the app actually removable? */
+       if (gs_app_has_quirk (app, GS_APP_QUIRK_COMPULSORY))
+               return;
+
        /* pending install */
        helper = g_slice_new0 (GsPageHelper);
        if (gs_app_get_kind (app) == AS_COMPONENT_KIND_REPOSITORY)


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