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




commit aa9001864f5e47a5d083f807a099c1e561dffb6e
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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/panels/firmware-security/cc-firmware-security-panel.c 
b/panels/firmware-security/cc-firmware-security-panel.c
index 28e7912d0..dc3bdb6a8 100644
--- a/panels/firmware-security/cc-firmware-security-panel.c
+++ b/panels/firmware-security/cc-firmware-security-panel.c
@@ -567,7 +567,10 @@ update_panel_visibility (const gchar *chassis_type)
   gboolean visible = TRUE;
 
   /* there's no point showing this */
-  if (g_strcmp0 (chassis_type, "vm") == 0)
+
+  printf ("chassis type is %d len %d\n", *chassis_type, strlen(chassis_type) );
+
+  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]