Add unarchiver support for cbr files
ClosedPublic

Authored by fb on Sep 22 2018, 3:52 PM.

Details

Summary

FEATURE: 339370
When no unrar installed, Okular now utilizes the program unar for extracting the archive and lsar for listing the content in the archive.
lsar is related and comes with a unar installation.

Diff Detail

Repository
R223 Okular
Branch
unar-patch
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 4332
Build 4350: arc lint + arc unit
fb created this revision.Sep 22 2018, 3:52 PM
Restricted Application added a project: Okular. · View Herald TranscriptSep 22 2018, 3:52 PM
Restricted Application added a subscriber: okular-devel. · View Herald Transcript
fb requested review of this revision.Sep 22 2018, 3:52 PM
fb updated this revision to Diff 42133.Sep 22 2018, 3:56 PM
This comment was removed by fb.
fb updated this revision to Diff 42134.Sep 22 2018, 4:00 PM
This comment was removed by fb.
fb updated this revision to Diff 42137.Sep 22 2018, 4:13 PM

removed .gitignore file

aacid added a subscriber: aacid.Sep 22 2018, 4:33 PM

So there's unar and lsar? What's the difference? Can you add some more text to the summary explaining it?

fb edited the summary of this revision. (Show Details)Sep 22 2018, 4:47 PM
aacid added a comment.Oct 8 2018, 10:18 PM

I'm not thrilled about all these dynamic_cast< UnarFlavour * > in the ifs.

Do you think you could fine a way to extend UnrarFlavour with a few virtuals so instead of ifs you would call functions in the helper that would do the work?

i.e. something like processListing?

fb updated this revision to Diff 43886.Oct 18 2018, 5:55 PM
fb edited the summary of this revision. (Show Details)

Okay, I added the virtual functions and created the ProcessArgs type, for a better structure of the processed arguments.
These variables will then be used by the startSyncProcess function.

This patch doesn't work here.

I do

okular ~/okularfiles/cbr/TREX-BackStory.CBR

and then on Unrar::list
listFile is "TREX-BackStory/00-Cover.jpg", "TREX-BackStory/00-IC-Info.jpg", "TREX-BackStory/01-Father.jpg", "TREX-BackStory/02-House.jpg", "TREX-BackStory/03-cameBack.jpg", "TREX-BackStory/03-Shadow.jpg", "TREX-BackStory/04-Pretty.jpg", "TREX-BackStory/05-RexsTurn.jpg", "TREX-BackStory/06-CreatureFight.jpg", "TREX-BackStory/07-RexPaintMore.jpg", "TREX-BackStory/08-RexBad.jpg", "TREX-BackStory/09-CatfishsDeal.jpg", "TREX-BackStory/10-RexWillHelp.jpg", "TREX-BackStory/11-FixBarn.jpg", "TREX-BackStory/12-StickMan.jpg", "TREX-BackStory/13-Tractor.jpg", "TREX-BackStory/14-ScareCrow.jpg", "TREX-BackStory/15-Weeding.jpg", "TREX-BackStory/16-VeryTired.jpg", "TREX-BackStory/17-NextMorning.jpg", "TREX-BackStory/18-BrerTemphi.jpg", "TREX-BackStory/19-Chaos.jpg", "TREX-BackStory/20-WorldMind.jpg", "TREX-BackStory/21-Problem.jpg", "TREX-BackStory/22-Ancestor.jpg", "TREX-BackStory/23-Cyclotron.jpg", "TREX-BackStory/24-Paintings.jpg", "TREX-BackStory/25-AstroNaught.jpg", "TREX-BackStory/26-Randian.jpg", "TREX-BackStory/26-Warning.jpg", "TREX-BackStory/27-TemphiFading.jpg", "TREX-BackStory/28-CatfishFights.jpg", "TREX-BackStory/29-RexWails.jpg", "TREX-BackStory/30-AstroPunch.jpg", "TREX-BackStory/31-RexAstroFight.jpg", "TREX-BackStory/32-MoreFight.jpg", "TREX-BackStory/33-AstroNaughtLeaves.jpg", "TREX-BackStory/34-RexSorry.jpg", "TREX-BackStory/35-RexLeaves.jpg", "TREX-BackStory/36-Credits.jpg", "TREX-BackStory/37-NMI-Ad.jpg", "TREX-BackStory/38-lettersPage.jpg", "TREX-BackStory/38-SentinelsAd.jpg", "TREX-BackStory/Thumbs.db", "TREX-BackStory/"
but newList is empty

It seems to me that the unar command is expanding the folder while the unrar one is not, and this is causing the problem.

fb updated this revision to Diff 44463.Oct 29 2018, 8:09 PM
  • Fix unar not recognizing subfolder

I think you mean unar is faulty here. Yes, it seems that unar is unable to extract the files in a directory without the subfolder from the archive.
I only tested comics without a subfolder so I didnt't encounterd this problem until now.
The -D option for unar doesn't seem to to anything useful here, so I removed it.

aacid accepted this revision.Nov 7 2018, 10:27 PM

I did a few minor changes, hope you don't disagree ^_^

This revision is now accepted and ready to land.Nov 7 2018, 10:27 PM
This revision was automatically updated to reflect the committed changes.