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




commit 90cd2f7a2c7cc64adb348845f032530ff1591657
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 28e7912d0..fd728cc7a 100644
--- a/panels/firmware-security/cc-firmware-security-panel.c
+++ b/panels/firmware-security/cc-firmware-security-panel.c
@@ -567,7 +567,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 || *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]