[nautilus/gnome-3-20] file-utilities: compute mount location title based on mount name



commit 5c6f284514569617e01d0dae4aef41eb0395e15f
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 e8def7f..529233c 100644
--- a/libnautilus-private/nautilus-file-utilities.c
+++ b/libnautilus-private/nautilus-file-utilities.c
@@ -257,6 +257,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
@@ -265,6 +266,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]