[nautilus] file: Fix remote filesystem check



commit 2ab0fcbdad71b6a9ebf94e0f65b1cb53f6219840
Author: Corey Berla <corey berla me>
Date:   Tue May 10 09:43:46 2022 -0700

    file: Fix remote filesystem check
    
    Files are flagged as remote in file->details->filesystem_remote
    through directory-async as folders are browsed.
    nautilus_file_get_filesystem_remote() incorrectly returns FALSE for
    child directories that have not been processed by directory-async
    on a remote filesystem.  This causes the "Count Number of Files in
    Folders" options to not work correctly when set to "On This Computer
    Only".  Rather than unnecessarily process all of the child folders,
    check whether filesystem_info_is_up_to_date==TRUE.  If not,
    check whether the parent is remote instead.
    
    This issue was introduced in 99f55748ef69a68df86b9a039998ee576d59b898.
    Previously the prefix of the URI was checked to match a hardcoded list.
    
    Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2035

 src/nautilus-file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 727181421..552167b2a 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -4737,7 +4737,7 @@ nautilus_file_get_filesystem_remote (NautilusFile *file)
 {
     g_assert (NAUTILUS_IS_FILE (file));
 
-    if (nautilus_file_is_directory (file))
+    if (nautilus_file_is_directory (file) && file->details->filesystem_info_is_up_to_date)
     {
         return file->details->filesystem_remote;
     }


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