Detect compression method
ClosedPublic

Authored by rthomsen on Oct 8 2016, 5:27 PM.

Details

Summary

A new property was added to Archive to store detected compression method(s). Currently, it's only displayed in PropertiesDialog, but the plan is to also use it to select a sane default compression method when adding files to an existing archive. Code was added to all plugins for detecting the compression method(s) when opening an archive and a signal added to ReadOnlyArchiveInterface to set the property.

Many archive types support multiple compression methods in same archive, so the property is a QStringList.

Test Plan

Open various archive types and check that the correct compression method is shown in PropertiesDialog.

Diff Detail

Repository
R36 Ark
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rthomsen updated this revision to Diff 7219.Oct 8 2016, 5:27 PM
rthomsen retitled this revision from to Detect compression method.
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 8 2016, 5:27 PM
elvisangelaccio requested changes to this revision.Oct 9 2016, 9:17 AM
elvisangelaccio edited edge metadata.
elvisangelaccio added inline comments.
kerfuffle/archive_kerfuffle.h
225

Missing reference in the argument

kerfuffle/archiveinterface.h
170

Can we call this compressionMethodFound? Same with the slots, e.g. onCompressionMethodFound

plugins/cli7zplugin/cliplugin.cpp
270–274

This check is duplicated in two plugins. Can we move it in the Archive's slot that sets the new property?

plugins/clirarplugin/cliplugin.cpp
220

This creates a temporary std::initializer list that is then converted to QStringList. A more efficient way is using QStringList {QStringLiteral("foo")}

222

same as above.

plugins/cliunarchiverplugin/cliplugin.cpp
245

QStringList {QStringLiteral("foo")}

247

QStringList {QStringLiteral("foo")}

plugins/libarchive/libarchiveplugin.cpp
63

QStringList {compMethod}

This revision now requires changes to proceed.Oct 9 2016, 9:17 AM
rthomsen updated this revision to Diff 7229.Oct 9 2016, 11:50 AM
rthomsen edited edge metadata.

Implement Elvis' suggestions.

rthomsen marked 7 inline comments as done.Oct 9 2016, 4:00 PM
rthomsen marked an inline comment as done.
elvisangelaccio accepted this revision.Oct 9 2016, 4:16 PM
elvisangelaccio edited edge metadata.
elvisangelaccio added inline comments.
plugins/libarchive/libarchiveplugin.cpp
542 ↗(On Diff #7229)

These else are not really necessary since they come after a return, but i guess this is a subjective style preference. Up to you :p

This revision is now accepted and ready to land.Oct 9 2016, 4:16 PM
This revision was automatically updated to reflect the committed changes.