Implement support for setting encryption method
ClosedPublic

Authored by rthomsen on Nov 7 2016, 6:41 PM.

Details

Summary

Needed infrastructure changes were done in ArchiveFormat, CliProperties and
other classes. A combobox was added to CreateDialog which enables setting the
encryption method.

Currently, only the Zip format when using cli7z supports multiple encryption
methods. For other formats that support only one encryption method, the method
is shown in the combobox.

This diff also enables detection of encryption method when opening archives
which is then shown in PropertiesDialog. To this end a new signal was added to
ReadOnlyArchiveInterface (encryptionMethodFound). The similar
compressionMethodFound signal was modified to only take one string instead of
QStringList.


Test Plan

Create pasword-protected Zip archive with cli7z and choose different encryption
methods. Verify that the selected method is used.
Check that correct encryption method is shown in PropertiesDialog when opening
various encrypted archives.

Diff Detail

Repository
R36 Ark
Branch
encmethod (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
rthomsen updated this revision to Diff 7990.Nov 7 2016, 6:41 PM
rthomsen retitled this revision from to Implement support for setting encryption method.
rthomsen updated this object.
rthomsen edited the test plan for this revision. (Show Details)
rthomsen added a reviewer: elvisangelaccio.
Restricted Application added a project: Ark. · View Herald TranscriptNov 7 2016, 6:41 PM
Restricted Application added a subscriber: kde-utils-devel. · View Herald Transcript
rthomsen updated this object.Nov 7 2016, 6:45 PM

Note that the new label and combobox are not vertically aligned with the ones for the password lineedits. I don't know if this is possible, since the whole password widget is like an independent group.

rthomsen updated this revision to Diff 7992.Nov 7 2016, 7:12 PM
rthomsen updated this object.

Rebased on current master.

elvisangelaccio requested changes to this revision.Nov 8 2016, 4:58 PM
elvisangelaccio edited edge metadata.
elvisangelaccio added inline comments.
kerfuffle/archive_kerfuffle.cpp
182

Double lookup, we can just use methods here.

196

Same here, use methods.

kerfuffle/archiveformat.cpp
48–49

Pass by reference

kerfuffle/archiveformat.h
50–51

Pass by reference.

kerfuffle/cliproperties.cpp
264

Double lookup, let's use a variable to hold the archive format object.

kerfuffle/compressionoptionswidget.cpp
277

This can be moved before the if/else

kerfuffle/propertiesdialog.cpp
87

I would keep the information about simple VS header-encryption. How about something like this:

Password-protected: No | Only files content (<enc. method>) | Yes (<enc. method>)

The last case is header encryption, but we don't really need to be that specific. After all it's our default in the CreateDialog, so a simple Yes could be enough here.

This revision now requires changes to proceed.Nov 8 2016, 4:58 PM
elvisangelaccio added inline comments.Nov 8 2016, 5:05 PM
kerfuffle/compressionoptionswidget.ui
123

The grid layout is the cause of the bad alignment you mentioned. Let's use a form layout here.

rthomsen updated this revision to Diff 8029.Nov 8 2016, 6:05 PM
rthomsen edited edge metadata.

Implement Elvis' suggestions

rthomsen marked 7 inline comments as done.Nov 8 2016, 6:08 PM
rthomsen added inline comments.
kerfuffle/compressionoptionswidget.ui
123

I changed it to a QFormLayout, but I'm not sure the alignment improved. What I meant is that the right side of the labels are not vertically aligned.

elvisangelaccio accepted this revision.Nov 8 2016, 6:36 PM
elvisangelaccio edited edge metadata.
This revision is now accepted and ready to land.Nov 8 2016, 6:36 PM
This revision was automatically updated to reflect the committed changes.