[gtk/cherry-pick-267ea755] placesview: Always open default location after mounting



commit b9e1ef1558d6ccf6ca3c644218d49b54f0fe77c4
Author: Ondrej Holy <oholy redhat com>
Date:   Thu Dec 19 15:49:07 2019 +0000

    placesview: Always open default location after mounting
    
    The default location (obtained over g_mount_get_default_location) is
    opened after mounting volume, or when opening mounts from sidebar, but
    not after mounting over "Connect to Server". Let's unify the behavior
    and always open the default location.
    
    https://gitlab.gnome.org/GNOME/nautilus/issues/1319
    
    
    (cherry picked from commit 267ea7552b35eb6eaf83767d58d0bef56ffd029a)

 gtk/gtkplacesview.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkplacesview.c b/gtk/gtkplacesview.c
index dab7f56f0a..62eb5d0914 100644
--- a/gtk/gtkplacesview.c
+++ b/gtk/gtkplacesview.c
@@ -1263,7 +1263,21 @@ server_mount_ready_cb (GObject      *source_file,
       gtk_entry_set_text (GTK_ENTRY (priv->address_entry), "");
 
       if (priv->should_open_location)
-        emit_open_location (view, location, priv->open_flags);
+        {
+          GMount *mount;
+          GFile *root;
+
+          mount = g_file_find_enclosing_mount (location, priv->cancellable, NULL);
+          if (mount)
+            {
+              root = g_mount_get_default_location (mount);
+
+              emit_open_location (view, root, priv->open_flags);
+
+              g_object_unref (root);
+              g_object_unref (mount);
+            }
+        }
     }
 
   update_places (view);


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