applications: Fix builtin-permissions showing when none are set

Shows the placeholder text "Yadda Yadda"
This commit is contained in:
Robert Ancell 2019-03-12 17:12:12 +13:00
parent be3ced3ff2
commit 6aa5961ef5

View file

@ -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);
}