libzipplugin: Simplify registration of progress callbacks
ClosedPublic

Authored by volkov on Oct 17 2018, 3:33 PM.

Details

Summary

Use zip_register_progress_callback_with_state() that was
introduced in libzip 1.3 (we already require this version).

Pass 0.001 as precision because this value is used for
old zip_register_progress_callback() inside libzip.
Also pass nullptr as a free function, because 'this' doesn't
need to be freed.

Diff Detail

Repository
R36 Ark
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 3988
Build 4006: arc lint + arc unit
volkov created this revision.Oct 17 2018, 3:33 PM
Restricted Application added a project: Ark. · View Herald TranscriptOct 17 2018, 3:33 PM
Restricted Application added subscribers: Ark, kde-utils-devel. · View Herald Transcript
volkov requested review of this revision.Oct 17 2018, 3:33 PM
volkov added a reviewer: Ark.Oct 17 2018, 3:34 PM

Thanks, looks much better now.

Why 0.001 though? Can't we use an higher value like 0.1?

The constant 0.001 is taken from libzip. It means that the callback will be called each time when compressing more than 1/1000 part of a file.
At least it doesn't change the old behavior.

This revision is now accepted and ready to land.Oct 30 2018, 9:05 PM
volkov closed this revision.Oct 31 2018, 10:36 AM