Do not create archives with double extension
ClosedPublic

Authored by tctara on Mar 21 2016, 6:09 AM.

Details

Summary

Fixing: https://.kde.org/show_bug.cgi?=282884
using QtFileInfo::baseName to strip file of its extension before adding the archive extension.

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.
tctara updated this revision to Diff 2870.Mar 21 2016, 6:09 AM
tctara retitled this revision from to Do not create archives with double extension.
tctara updated this object.
tctara edited the test plan for this revision. (Show Details)
tctara added a reviewer: elvisangelaccio.
tctara set the repository for this revision to R36 Ark.
tctara added a project: Ark.
Restricted Application added a subscriber: kde-utils-devel. · View Herald TranscriptMar 21 2016, 6:09 AM
elvisangelaccio requested changes to this revision.Mar 21 2016, 1:01 PM
elvisangelaccio edited edge metadata.
elvisangelaccio added inline comments.
kerfuffle/addtoarchive.cpp
242

Better use fileInfo for this variable name

253

What happens if I compress a file with name README-v1.4.2.txt ?
I get e.g. a zip file with name README-v1.zip, which is now what I expect.

Have a look at the function Archive::completeBaseName(), you should do the same thing here :)

This revision now requires changes to proceed.Mar 21 2016, 1:01 PM
tctara updated this revision to Diff 2889.Mar 21 2016, 6:01 PM
tctara updated this object.
tctara edited edge metadata.
elvisangelaccio accepted this revision.Mar 21 2016, 9:44 PM
elvisangelaccio edited edge metadata.

Thanks, nice work. Let's wait for Ragnar's ok.

This revision is now accepted and ready to land.Mar 21 2016, 9:44 PM
rthomsen accepted this revision.Mar 22 2016, 7:00 AM
rthomsen edited edge metadata.

Code looks good. Tested and seems to work properly. Great work :)

kerfuffle/addtoarchive.cpp
248

Please start comments with capital letter, and end with period. Same below.

Remember to push this to Applications/16.04 branch :)

rthomsen added inline comments.Mar 22 2016, 7:11 AM
kerfuffle/addtoarchive.cpp
243

Please change the name of this variable to "parentDir", to make code more readable.

tctara updated this revision to Diff 2896.Mar 22 2016, 8:32 AM
tctara edited edge metadata.
tctara marked 2 inline comments as done.
This revision was automatically updated to reflect the committed changes.