[nautilus] file-operations: don't recurse for trash operations



commit d4a4f7915ccad4fbe9bb726dd9f876738c7960d4
Author: Carlos Soriano <csoriano gnome org>
Date:   Thu Nov 24 13:32:02 2016 +0100

    file-operations: don't recurse for trash operations
    
    We were scanning the sources as we do for copy and move operations,
    and to count the files we were recursing inside directories.
    
    However, the trash operation doesn't recurse at all, so the operation
    progress was wrong.
    
    Instead of that, don't recurse for counting the number of files, so the
    trash progress is correct. Although is not coherent with the rest of the
    operations, recursing for just showing all the files in the progress
    would be extremely counterproductive.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=775094

 src/nautilus-file-operations.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index dfe673e..af08b51 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -3348,7 +3348,9 @@ retry:
 
             count_file (info, job, source_info);
 
-            if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY)
+            /* trashing operation doesn't recurse */
+            if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY &&
+                source_info->op != OP_KIND_TRASH)
             {
                 g_queue_push_head (dirs, g_object_ref (file));
             }


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