summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2023-01-30 08:25:12 +0100
committerOndrej Holy <oholy@redhat.com>2023-04-06 10:40:31 +0200
commite00de88a3dd049dbc013f461880d65e1d0957379 (patch)
treed4d34cd696197ac0b3ea331c1bb2932292ecce88
parent2f20024fab143671f1bdee8637872ee3f115a4eb (diff)
downloadnautilus-e00de88a3dd049dbc013f461880d65e1d0957379.tar.gz
window-slot: Jump to parent also for non-native locations
When the current location is marked as gone, Nautilus jumps to the first existing parent currently (except when unmounted), but only for native locations. I don't see reasons why not to jump to parent also for GVfs locations when they are still mounted (though not many of them support file monitors). Let's change that.
-rw-r--r--src/nautilus-window-slot.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index f68aa90c8..de2d86e18 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -1442,10 +1442,10 @@ viewed_file_changed_callback (NautilusFile *file,
{
if (self->viewed_file_seen)
{
- GFile *go_to_file;
+ GFile *go_to_file = NULL;
GFile *location;
GMount *mount;
- gboolean find_existing = FALSE;
+ gboolean find_existing = TRUE;
location = nautilus_file_get_location (file);
@@ -1456,7 +1456,6 @@ viewed_file_changed_callback (NautilusFile *file,
* unmounted at this point.
*/
mount = nautilus_file_get_enclosing_mount (file);
- find_existing = TRUE;
if (mount != NULL)
{
@@ -1479,6 +1478,14 @@ viewed_file_changed_callback (NautilusFile *file,
g_clear_object (&mount);
}
+ else
+ {
+ /* The existence of the mount can't be verified the same way as
+ * for the native files, but it doesn't matter. The
+ * nautilus_find_existing_uri_in_hierarchy function will simply
+ * return NULL if the location was unmounted.
+ */
+ }
if (find_existing)
{
@@ -1487,7 +1494,8 @@ viewed_file_changed_callback (NautilusFile *file,
*/
go_to_file = nautilus_find_existing_uri_in_hierarchy (location);
}
- else
+
+ if (go_to_file == NULL)
{
go_to_file = g_file_new_for_path (g_get_home_dir ());
}