[gnome-autoar/wip/oholy/various-fixes: 17/17] extractor: Reduce the number of files and size when skipping




commit 79d00ee029f3dbd6d946f201733f052d5f336f42
Author: Ondrej Holy <oholy redhat com>
Date:   Wed Feb 24 16:43:29 2021 +0100

    extractor: Reduce the number of files and size when skipping
    
    In case of conflict, when skipping some file, the `total_size` and `total_files`
    is not updated, but neither `completed_files` and `completed_size`. Let's
    reduce the `total_size` and `total_files`. Same approach is used in Nautilus
    when skipping.

 gnome-autoar/autoar-extractor.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gnome-autoar/autoar-extractor.c b/gnome-autoar/autoar-extractor.c
index 1532c3e..2982cc6 100644
--- a/gnome-autoar/autoar-extractor.c
+++ b/gnome-autoar/autoar-extractor.c
@@ -2033,6 +2033,8 @@ autoar_extractor_step_extract (AutoarExtractor *self) {
     }
 
     if (file_conflict && action == AUTOAR_CONFLICT_SKIP) {
+      self->total_files -= 1;
+      self->total_size -= archive_entry_size (entry);
       continue;
     }
 


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