Show progress in percentage for all job types in LibarchivePlugin
ClosedPublic

Authored by rthomsen on Oct 16 2016, 2:04 PM.

Details

Summary

Progress is now also shown in percentage for Addjob, CopyJob, DeleteJob and MoveJob for archives handled by LibarchivePlugin. This was a bit tricky due to libarchive always iterating the whole archive and means that the plugin needs to know the total number of existing archive entries.

A new member variable m_numberOfEntries was added to ReadOnlyArchiveInterface, which holds the total number of entries in the archive. The variable is kept up-to-date by incrementing/decrementing it whenever the entry and entryRemoved signals are emitted by a plugin. This necessitated a slight rework of the handling of MoveJob and CopyJob by LibarchivePlugin because these emitted entry when iterating over the old entries. The new approach should also be more efficient.

The two Archive members m_numberOfFiles and m_numberOfFolders were removed.

ReadOnlyArchiveInterface::addFiles() got an additional argument of type uint that holds the number of entries to be added.

Test Plan

Run the four job types:

  • AddJob (try adding files both to an empty archive and an existing archive)
  • CopyJob
  • DeleteJob
  • MoveJob

And check that progress is shown in percentage in the status bar.

Diff Detail

Repository
R36 Ark
Lint
Lint Skipped
Unit
Unit Tests Skipped
rthomsen updated this revision to Diff 7422.Oct 16 2016, 2:04 PM
rthomsen retitled this revision from to Show progress in percentage for all job types in 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 16 2016, 2:04 PM
rthomsen added inline comments.Oct 16 2016, 2:05 PM
plugins/libarchive/readwritelibarchiveplugin.cpp
457 ↗(On Diff #7422)

This line can be uncommented to show progress in debug output. I'll remove it when committing.

rthomsen updated this object.Oct 16 2016, 2:07 PM
rthomsen updated this revision to Diff 7468.Oct 17 2016, 4:42 PM
rthomsen updated this object.

See updated summary.

rthomsen updated this object.Oct 17 2016, 4:49 PM
rthomsen updated this revision to Diff 7469.Oct 17 2016, 5:09 PM

Set m_numberOfEntries to zero before listing in ClInterface.

elvisangelaccio requested changes to this revision.Oct 17 2016, 5:15 PM
elvisangelaccio edited edge metadata.
elvisangelaccio added inline comments.
kerfuffle/archiveinterface.h
196

This belongs to ReadWriteArchiveInterface, since the read-only one can't remove entries.

This revision now requires changes to proceed.Oct 17 2016, 5:15 PM
elvisangelaccio accepted this revision.Oct 17 2016, 5:23 PM
elvisangelaccio edited edge metadata.
elvisangelaccio added inline comments.
kerfuffle/archiveinterface.h
196

This needs a seperate commit actually.

This revision is now accepted and ready to land.Oct 17 2016, 5:23 PM