]> git.ipfire.org Git - pakfire.git/commitdiff
filelist: Increment progress after a file has been processed
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 4 Jan 2025 13:29:10 +0000 (13:29 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 4 Jan 2025 13:29:10 +0000 (13:29 +0000)
The progressbar suspiciously was "done" when there was still some work
to do and the application looked like it had stalled.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/filelist.c

index ccbfeb82f9f18cfbe972ed766e2d3cbbd3d982d8..552023fe594dc48c03a01d64b37749ccb4c6e0c7 100644 (file)
@@ -478,14 +478,14 @@ int pakfire_filelist_walk(struct pakfire_filelist* list,
 
        // Call the callback once for every element on the list
        for (unsigned int i = 0; i < list->num_files; i++) {
-               // Increment the progress
-               if (progress)
-                       pakfire_progress_increment(progress, 1);
-
                // Call the callback
                r = callback(list->ctx, list->files[i], data);
                if (r)
                        goto ERROR;
+
+               // Increment the progress
+               if (progress)
+                       pakfire_progress_increment(progress, 1);
        }
 
        // Done!