[nautilus/wip/corey/properties: 4/4] properties: Use Operating System name for root filesystem




commit a76396afdfa2a502ed016dd1e8d3d333215c33ac
Author: Corey Berla <corey berla me>
Date:   Tue Aug 23 11:12:07 2022 -0700

    properties: Use Operating System name for root filesystem
    
    For consistency with what we do in Places, use the operating system
    name or "Operating System" instead of "/"

 src/nautilus-properties-window.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 5f99e1fdd..cb14a6ab6 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -855,6 +855,8 @@ static void
 update_name_field (NautilusPropertiesWindow *self)
 {
     g_autoptr (GString) name_str = g_string_new ("");
+    g_autofree gchar *os_name = NULL;
+    gchar *name_value;
     guint file_counter = 0;
 
     for (GList *l = self->target_files; l != NULL; l = l->next)
@@ -876,7 +878,17 @@ update_name_field (NautilusPropertiesWindow *self)
         }
     }
 
-    gtk_label_set_text (self->name_value_label, name_str->str);
+    if (!is_multi_file_window (self) && is_root_directory (get_original_file (self)))
+    {
+        os_name = g_get_os_info (G_OS_INFO_KEY_NAME);
+        name_value = (os_name != NULL) ? os_name : _("Operating System");
+    }
+    else
+    {
+        name_value = name_str->str;
+    }
+
+    gtk_label_set_text (self->name_value_label, name_value);
 }
 
 /**


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