Show progress in percentage when listing archives with libarchiveplugin
ClosedPublic

Authored by rthomsen on Oct 4 2016, 8:12 PM.

Details

Summary

After having fiddled around with callback functions for several hours, I stumbled upon this very nice function:

archive_filter_bytes(struct archive *, int)

The function returns the number of bytes read from the archive and thus can be used for computing progress of listing an archive. The second argument is -1 for the outmost filter (see archive.h in libarchive source). The progress can now be calculated with this simple two-line patch.

Test Plan
  1. List large archives with libarchiveplugin (try various formats).
  2. Check that the progress is shown in percentage in statusbar.

Diff Detail

Repository
R36 Ark
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rthomsen updated this revision to Diff 7100.Oct 4 2016, 8:12 PM
rthomsen retitled this revision from to Show progress in percentage when listing archives with libarchiveplugin.
rthomsen updated this object.
rthomsen edited the test plan for this revision. (Show Details)
rthomsen added a reviewer: elvisangelaccio.
rthomsen set the repository for this revision to R36 Ark.
rthomsen added a project: Ark.
Restricted Application added a subscriber: kde-utils-devel. · View Herald TranscriptOct 4 2016, 8:12 PM
elvisangelaccio accepted this revision.Oct 5 2016, 11:13 AM
elvisangelaccio edited edge metadata.

Great. What about the progress in the system tray? (I'm not sure it ever worked for listjobs)

This revision is now accepted and ready to land.Oct 5 2016, 11:13 AM