[nautilus/wip/oholy/progress-fixes: 2/2] file-operations: Print number of natively moved files instead of zero




commit ab66f79e7369bd377f5302769a12f7ab05b50c9a
Author: Ondrej Holy <oholy redhat com>
Date:   Mon Oct 19 14:18:10 2020 +0200

    file-operations: Print number of natively moved files instead of zero
    
    Currently, "Moved 0 files to ..." status is shown if all files were moved
    during the initial phase. This is because the initial phase consists of
    `g_file_move` calls with `G_FILE_COPY_NO_FALLBACK_FOR_MOVE` flag, however,
    the status is printed for files which needs copy&delete fallback. Let's
    print the total number of natively moved files in this case instead.
    
    Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1635

 src/nautilus-file-operations.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index 413419a84..1dd7bd715 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -6623,6 +6623,21 @@ nautilus_file_operations_move (GTask        *task,
         goto aborted;
     }
 
+    if (fallbacks == NULL)
+    {
+        gint total;
+
+        total = g_list_length (job->files);
+
+        memset (&source_info, 0, sizeof (source_info));
+        source_info.num_files = total;
+        memset (&transfer_info, 0, sizeof (transfer_info));
+        transfer_info.num_files = total;
+        report_copy_progress (job, &source_info, &transfer_info);
+
+        return;
+    }
+
     /* The rest we need to do deep copy + delete behind on,
      *  so scan for size */
 


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