diff options
author | António Fernandes <antoniof@gnome.org> | 2020-05-13 01:27:33 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2021-01-25 10:54:10 +0000 |
commit | b3a6ec8293c5f47ac2ef6583e1627bcb85fba020 (patch) | |
tree | f8b926ce5f9811f9bf788efbc739c50c9d244374 | |
parent | f0759d6fe9bb405c3e9a5a5cf2e9509514f4eb6f (diff) | |
download | nautilus-b3a6ec8293c5f47ac2ef6583e1627bcb85fba020.tar.gz |
file: Correctly check for remoteness for speed tradeoffs
When the thumbnailing and/or item counting preference is 'local-only',
we need to know if a file is local or remote, and for this we use the
nautilus_file_is_local() method.
However, ever since the port from gnome-vfs to GIO, this method relies
on g_file_is_native() instead of gnome_vfs_uri_is_local(), which are
not the same thing. Quoting the GIO docs:
> A native file is one expressed in the platform-native filename
> format, e.g. "C:\Windows" or "/usr/bin/". This does not mean the
> file is local, as it might be on a locally mounted remote filesystem.
So, nautilus_file_is_local() is no longer telling us the truth. This
means we may show thumbnails or item counts for natively-mounted remote
locations when we are not supposed to.
Instead, let's use the nautilus_file_is_remote() method, which relies
on the G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE attribute (which was not
implemented at the time of the GIO port).
Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1478
-rw-r--r-- | src/nautilus-file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nautilus-file.c b/src/nautilus-file.c index 243470432..a9047d3de 100644 --- a/src/nautilus-file.c +++ b/src/nautilus-file.c @@ -4798,7 +4798,7 @@ nautilus_file_should_show_thumbnail (NautilusFile *file) else { /* only local files */ - return nautilus_file_is_local (file); + return !nautilus_file_is_remote (file); } } @@ -5702,7 +5702,7 @@ get_speed_tradeoff_preference_for_file (NautilusFile *file, else { /* only local files */ - return nautilus_file_is_local (file); + return !nautilus_file_is_remote (file); } } |