[nautilus] file-operations: change skip behavior



commit f80af5094c1d342c56d21e29942221f6836e3cd0
Author: Ernestas Kulik <ernestask gnome org>
Date:   Sat Mar 4 14:45:51 2017 +0200

    file-operations: change skip behavior
    
    Currently, when skipping files, they are added to the transfer counts,
    which results in inflated progress information. This commit makes the
    code subtract from the total counts, instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=779569

 src/nautilus-file-operations.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index 76b37ad..d25a93a 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -2262,9 +2262,9 @@ skip:
 }
 
 static void
-transfer_add_file_to_count (GFile        *file,
-                            CommonJob    *job,
-                            TransferInfo *transfer_info)
+source_info_remove_file_from_count (GFile        *file,
+                                    CommonJob    *job,
+                                    SourceInfo   *source_info)
 {
     g_autoptr (GFileInfo) file_info = NULL;
 
@@ -2279,10 +2279,10 @@ transfer_add_file_to_count (GFile        *file,
                                    job->cancellable,
                                    NULL);
 
-    transfer_info->num_files++;
+    source_info->num_files--;
     if (file_info != NULL)
     {
-        transfer_info->num_bytes += g_file_info_get_size (file_info);
+        source_info->num_bytes -= g_file_info_get_size (file_info);
     }
 }
 
@@ -2332,7 +2332,7 @@ trash_files (CommonJob *job,
         if (skipped_file)
         {
             (*files_skipped)++;
-            transfer_add_file_to_count (file, job, &transfer_info);
+            source_info_remove_file_from_count (file, job, &source_info);
             report_trash_progress (job, &source_info, &transfer_info);
         }
     }
@@ -4679,7 +4679,7 @@ retry:
 
             if (local_skipped_file)
             {
-                transfer_add_file_to_count (src_file, job, transfer_info);
+                source_info_remove_file_from_count (src_file, job, source_info);
                 report_copy_progress (copy_job, source_info, transfer_info);
             }
 
@@ -5757,7 +5757,7 @@ copy_files (CopyMoveJob  *job,
 
             if (skipped_file)
             {
-                transfer_add_file_to_count (src, common, transfer_info);
+                source_info_remove_file_from_count (src, common, source_info);
                 report_copy_progress (job, source_info, transfer_info);
             }
         }
@@ -6412,7 +6412,7 @@ move_files (CopyMoveJob   *job,
 
         if (skipped_file)
         {
-            transfer_add_file_to_count (src, common, transfer_info);
+            source_info_remove_file_from_count (src, common, source_info);
             report_copy_progress (job, source_info, transfer_info);
         }
     }


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