Fix entry counter in libarchiveplugin when overwriting entries
ClosedPublic

Authored by rthomsen on Nov 5 2016, 6:43 PM.

Details

Summary

When adding files to an archive with libarchiveplugin and the destination files already exist (so they get overwritten), the entry signal is still emitted and hence m_numberOfEntries gets wrongfully incremented. This diff decrements the counter when an entry already exists.

Overwriting of entries is disabled for CopyJob and MoveJob, so there is no problem in those cases.

Test Plan

A test case was added to AddTest which detects the wrong counter when overwriting an entry.

Diff Detail

Repository
R36 Ark
Lint
Lint Skipped
Unit
Unit Tests Skipped
rthomsen updated this revision to Diff 7929.Nov 5 2016, 6:43 PM
rthomsen retitled this revision from to Fix entry counter in libarchiveplugin when overwriting entries.
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 TranscriptNov 5 2016, 6:43 PM
rthomsen updated this revision to Diff 7930.Nov 5 2016, 6:44 PM

Also add the new text file for the test.

elvisangelaccio accepted this revision.Nov 6 2016, 6:35 PM
elvisangelaccio edited edge metadata.
This revision is now accepted and ready to land.Nov 6 2016, 6:35 PM