[nautilus] file-utilities: compute mount location title based on mount name



commit 0e3ebc7cdbba0df6673c3ba1ee1c2fc26d11f8f5
Author: Razvan Chitu <razvan ch95 gmail com>
Date:   Mon Apr 4 11:46:19 2016 +0300

    file-utilities: compute mount location title based on mount name
    
    The label of a mounted location is displayed differently in the pathbar and in
    an open tab, due to different means of obtaining the location title. In order to
    fix this, use the mount name when computing the mount title for an open tab.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=764573

 libnautilus-private/nautilus-file-utilities.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file-utilities.c b/libnautilus-private/nautilus-file-utilities.c
index 80303b6..84dcd59 100644
--- a/libnautilus-private/nautilus-file-utilities.c
+++ b/libnautilus-private/nautilus-file-utilities.c
@@ -256,6 +256,7 @@ char *
 nautilus_compute_title_for_location (GFile *location)
 {
        NautilusFile *file;
+        GMount *mount;
        char *title;
 
        /* TODO-gio: This doesn't really work all that great if the
@@ -264,6 +265,14 @@ nautilus_compute_title_for_location (GFile *location)
        if (nautilus_is_home_directory (location)) {
                return g_strdup (_("Home"));
        }
+
+        if ((mount = nautilus_get_mounted_mount_for_root (location)) != NULL) {
+                title = g_mount_get_name(mount);
+
+                g_object_unref(mount);
+
+                return title;
+        }
        
        title = NULL;
        if (location) {


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