[gnome-software] Do not allow core applications to be removed



commit d13090764a12fda2de3eaafb3a2a7daaaebc5b30
Author: Richard Hughes <richard hughsie com>
Date:   Fri Aug 23 09:29:16 2013 +0100

    Do not allow core applications to be removed

 src/gs-shell.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index e8d856a..f37fb5d 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -71,6 +71,7 @@ gs_shell_set_overview_mode_ui (GsShell *shell, GsShellMode mode, GsApp *app)
 {
        GtkWidget *widget;
        GsAppState state;
+       GsAppKind kind;
        GsShellPrivate *priv = shell->priv;
 
        priv->ignore_primary_buttons = TRUE;
@@ -110,15 +111,16 @@ gs_shell_set_overview_mode_ui (GsShell *shell, GsShellMode mode, GsApp *app)
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_back"));
                gtk_widget_set_visible (widget, TRUE);
                if (app) {
+                       kind = gs_app_get_kind (app);
                        state = gs_app_get_state (app);
-               }
-               else {
+               } else {
+                       kind = GS_APP_KIND_UNKNOWN;
                        state = GS_APP_STATE_UNKNOWN;
                }
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_install"));
                gtk_widget_set_visible (widget, state == GS_APP_STATE_AVAILABLE);
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_remove"));
-               gtk_widget_set_visible (widget, state == GS_APP_STATE_INSTALLED);
+               gtk_widget_set_visible (widget, state == GS_APP_STATE_INSTALLED && kind == 
GS_APP_KIND_NORMAL);
 #ifdef SEARCH
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "search_bar"));
                gtk_widget_set_visible (widget, FALSE);


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