[nautilus/gnome-3-22] file-operations: don't recurse for trash operations



commit acc282ce4e391a3d197082ec26973c6764c277d5
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 c491daf..eaf8cd4 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]