[gnome-control-center/wip/kate/empty-string-as-vm: 8/8] firmware-security: Hide the panel when chassis type is an empty string




commit 0245329949957e7f7ab56f240faaf336408ced86
Author: Kate Hsuan <hpa redhat com>
Date:   Wed Aug 24 14:34:50 2022 +0800

    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>

 panels/firmware-security/cc-firmware-security-panel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
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),


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