[nautilus/wip/antoniof/local_vs_native_fixup: 144/157] file: Correctly check for remoteness for speed tradeoffs
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/local_vs_native_fixup: 144/157] file: Correctly check for remoteness for speed tradeoffs
- Date: Mon, 14 Dec 2020 19:00:49 +0000 (UTC)
commit ddefab0ac3130c37d4b8758c18ca52139aa1fe39
Author: António Fernandes <antoniof gnome org>
Date: Wed May 13 01:27:33 2020 +0100
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
src/nautilus-file.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 1fa5bdad5..bc7733e09 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -4772,7 +4772,7 @@ nautilus_file_should_show_thumbnail (NautilusFile *file)
else
{
/* only local files */
- return nautilus_file_is_local (file);
+ return !nautilus_file_is_remote (file);
}
}
@@ -5675,7 +5675,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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]