Implement support for multi-volume archives
ClosedPublic

Authored by rthomsen on Jul 16 2016, 4:52 PM.

Details

Reviewers
elvisangelaccio
Summary

This diff adds support for creating multi-volume rar and 7z archives. A QDoubleSpinBox was added to CompressionOptionsWidget which allows setting the volume size in megabytes between 0.1 to 1000. The size in megabytes is converted by CompressionOptionsWidget to kilobytes because 7z doesn't support volumesizes with decimals.

Creating a multi-volume archive changes the archive name (name.part01.rar and name.7z.001) so we need to re-open the archive (the first volume) after adding files.

We only support adding files once, so add/delete actions are disabled in Part if archive is multi-volume and non-empty.


Test Plan

Create multi-volume rar and 7z archives with various volume sizes.

Diff Detail

Repository
R36 Ark
Lint
Lint Skipped
Unit
Unit Tests Skipped
rthomsen updated this revision to Diff 5230.Jul 16 2016, 4:52 PM
rthomsen retitled this revision from to Implement support for multi-volume archives.
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 TranscriptJul 16 2016, 4:52 PM
rthomsen updated this revision to Diff 5231.Jul 16 2016, 6:59 PM

Rebase against current Applications/16.08 branch.

Some of the functionality was implemented separately.

rthomsen updated this revision to Diff 5232.Jul 16 2016, 7:16 PM

Fix a bug. Creating zip archives with cli7z didnt work because it passed an archive volume of 0 to 7z. This caused the AddToArchive test to fail.

rthomsen updated this object.Jul 16 2016, 7:29 PM
rthomsen updated this object.Jul 17 2016, 8:55 AM
rthomsen updated this revision to Diff 5238.EditedJul 17 2016, 1:01 PM

Rebase against current Applications/16.08 branch.

Also, when adding files to a multi-volume archive, dont list the archive before re-opening.

rthomsen updated this revision to Diff 5240.Jul 17 2016, 2:33 PM

rar is inconsistent when naming parts of multi-volume archive. Sometimes they will be called name.part1.rar, name.part2.rar etc. and other times name.part01.rar, name.part02.rar etc. We now use a QStringList to list both possible suffixes and check using a QFileInfo if either of the two exists before re-opening archive.

elvisangelaccio requested changes to this revision.Jul 19 2016, 10:45 AM
elvisangelaccio edited edge metadata.

Patch doesn't apply, can you rebase? :)

autotests/plugins/cli7zplugin/cli7ztest.cpp
308 ↗(On Diff #5240)

Can you add at least one test case in which we do set a volume number? Same with the rar test

kerfuffle/cliinterface.cpp
840 ↗(On Diff #5240)

What does 1024000 represent?

kerfuffle/compressionoptionswidget.cpp
66 ↗(On Diff #5240)

We already compute this number in volumeSize(), so we can just call this function.

This revision now requires changes to proceed.Jul 19 2016, 10:45 AM
rthomsen added inline comments.Jul 19 2016, 12:00 PM
kerfuffle/cliinterface.cpp
840 ↗(On Diff #5240)

1000 megabytes. The maximum of the QDoubleSpinBox.

rthomsen added inline comments.Jul 19 2016, 12:08 PM
kerfuffle/cliinterface.cpp
840 ↗(On Diff #5240)

Actually, 1000 megabytes as kilobytes :)

rthomsen updated this revision to Diff 5319.Jul 19 2016, 5:10 PM
rthomsen edited edge metadata.

Rebase against current Applications/16.08 branch. Fix a bug.

rthomsen added inline comments.Jul 21 2016, 8:52 AM
autotests/plugins/cli7zplugin/cli7ztest.cpp
308 ↗(On Diff #5240)

I'm planning to add unit tests for multi-volume archives later. We need to get this in before deadline.

Yesterday I forgot to tell you that I still can't apply the patch. Needs more rebasing?

Yesterday I forgot to tell you that I still can't apply the patch. Needs more rebasing?

Ok, I'll rebase again when I get home later today.

rthomsen updated this revision to Diff 5395.Jul 21 2016, 3:46 PM
rthomsen edited edge metadata.

Rebase again.

elvisangelaccio requested changes to this revision.Jul 21 2016, 5:23 PM
elvisangelaccio edited edge metadata.
elvisangelaccio added inline comments.
autotests/plugins/cli7zplugin/cli7ztest.cpp
308 ↗(On Diff #5240)

Ok :)

kerfuffle/cliinterface.cpp
840 ↗(On Diff #5240)

Ok, please write this in a comment ;)

kerfuffle/compressionoptionswidget.ui
144 ↗(On Diff #5240)

This should be a form layout. There is currently too much empty space on the left of the Volume size: label.

You should also set some left padding in this layout, so that you will look indented with respect to the checkbox above.

182 ↗(On Diff #5240)

What about a step of 0.5? The user can always type with the keyboard for smaller granularity...

This revision now requires changes to proceed.Jul 21 2016, 5:23 PM
rthomsen updated this revision to Diff 5397.Jul 21 2016, 6:18 PM
rthomsen edited edge metadata.
  • Implement Elvis' suggestions.
  • Enable multi-volume support for zip archives in cli7z (clizip does not support this feature).
rthomsen updated this object.Jul 21 2016, 6:21 PM
rthomsen edited edge metadata.
rthomsen marked 10 inline comments as done.
elvisangelaccio accepted this revision.Jul 21 2016, 6:40 PM
elvisangelaccio edited edge metadata.
This revision is now accepted and ready to land.Jul 21 2016, 6:40 PM
rthomsen closed this revision.Jul 22 2016, 4:51 AM

Committed with bf6425d17578.