summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKate Hsuan <hpa@redhat.com>2022-08-24 14:34:50 +0800
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2022-08-24 14:39:33 +0000
commit0245329949957e7f7ab56f240faaf336408ced86 (patch)
tree9531d2e7544ad5d093cb91d75201f0c1548390d9
parentb6c6f5c165fc22a0efac852bdc8db0ee10fe20a1 (diff)
downloadgnome-control-center-0245329949957e7f7ab56f240faaf336408ced86.tar.gz
firmware-security: Hide the panel when chassis type is an empty string
When requesting the chassis type through systemd-hostnamed, it sometimes returns an empty string "" not the "vm" to present the virtual machine. Since this panel will not be shown in the VM environment, if systemd-hostnamed returns an empty string or "vm", the panel will be hidden. Signed-off-by: Kate Hsuan <hpa@redhat.com>
-rw-r--r--panels/firmware-security/cc-firmware-security-panel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/panels/firmware-security/cc-firmware-security-panel.c b/panels/firmware-security/cc-firmware-security-panel.c
index c68d0e0ee..70a8664fe 100644
--- a/panels/firmware-security/cc-firmware-security-panel.c
+++ b/panels/firmware-security/cc-firmware-security-panel.c
@@ -589,7 +589,7 @@ update_panel_visibility (const gchar *chassis_type)
gboolean visible = TRUE;
/* there's no point showing this */
- if (g_strcmp0 (chassis_type, "vm") == 0)
+ if (g_strcmp0 (chassis_type, "vm") == 0 || g_strcmp0 (chassis_type, "") == 0)
visible = FALSE;
application = CC_APPLICATION (g_application_get_default ());
cc_shell_model_set_panel_visibility (cc_application_get_model (application),