[gnome-control-center] applications: Fix builtin-permissions showing when none are set



commit 6aa5961ef5e1d42a4362f1c4f61fe55d7ec9d78d
Author: Robert Ancell <robert ancell canonical com>
Date:   Tue Mar 12 17:12:12 2019 +1300

    applications: Fix builtin-permissions showing when none are set
    
    Shows the placeholder text "Yadda Yadda"

 panels/applications/cc-applications-panel.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/panels/applications/cc-applications-panel.c b/panels/applications/cc-applications-panel.c
index a0ac02417..addf004b4 100644
--- a/panels/applications/cc-applications-panel.c
+++ b/panels/applications/cc-applications-panel.c
@@ -620,8 +620,6 @@ add_static_permissions (CcApplicationsPanel *self,
   if (str && g_str_equal (str, "talk"))
     added += add_static_permission_row (self, _("Settings"), _("Can change settings"));
 
-  gtk_widget_set_visible (self->builtin, added > 0);
-
   text = g_strdup_printf (_("%s has the following permissions built-in. These cannot be altered. If you are 
concerned about these permissions, consider removing this application."), g_app_info_get_display_name (info));
   gtk_label_set_label (GTK_LABEL (self->builtin_label), text);
 
@@ -640,7 +638,7 @@ update_permission_section (CcApplicationsPanel *self,
 {
   g_autofree gchar *flatpak_id = get_flatpak_id (info);
   gboolean disabled, allowed, set;
-  gboolean has_any = FALSE;
+  gboolean has_any = FALSE, has_builtin = FALSE;
 
   if (flatpak_id == NULL)
     {
@@ -670,7 +668,9 @@ update_permission_section (CcApplicationsPanel *self,
   has_any |= set;
 
   remove_static_permissions (self);
-  has_any |= add_static_permissions (self, info, flatpak_id);
+  has_builtin = add_static_permissions (self, info, flatpak_id);
+  gtk_widget_set_visible (self->builtin, has_builtin);
+  has_any |= has_builtin;
 
   gtk_widget_set_visible (self->permission_section, has_any);
 }


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