Add new protocol for 7z archives
AcceptedPublic

Authored by nhiga on Thu, Sep 5, 12:08 PM.

Details

Summary

This patch adds a new protocol, sevenz, for 7z archives by utilizing K7Zip. Previously, users have to install Krusader to use its krarc protocol to navigate a 7z archive using Dolphin.

Depends on D23780
Depends on D23490

Test Plan

Compile and install KIO with D23490 and D23780 applied.

(If Krusader is installed, change krarc to sevenz in the URL bar if necessary.)

Test using Dolphin:
Enable "Open archives as folder" in Dolphin, then open and browse a 7z archive using the sevenz protocol.

Test using Gwenview:
View a 7z archive containing photos. Browse and view images inside the archive.

Diff Detail

Repository
R320 KIO Extras
Lint
Lint Skipped
Unit
Unit Tests Skipped
nhiga created this revision.Thu, Sep 5, 12:08 PM
Restricted Application added a project: Dolphin. · View Herald TranscriptThu, Sep 5, 12:08 PM
Restricted Application added a subscriber: kfm-devel. · View Herald Transcript
nhiga requested review of this revision.Thu, Sep 5, 12:08 PM
nhiga added a comment.EditedThu, Sep 5, 12:19 PM

Notes:

  1. I am not sure whether it is needed to include k7zip.h in archive/kio_archivebase.cpp.
  2. It can take some time to load the 7z archive using this new protocol.
ngraham added a subscriber: ngraham.Thu, Sep 5, 1:40 PM

Probably best to submit the KIO patch first.

meven accepted this revision.Thu, Sep 5, 1:41 PM
meven added a subscriber: meven.

Probably best to submit the KIO patch first.

D23490 has been accepted already.

Tested with D23490 and without krusader installed, opens 7zip archive in dolphin.

Works like a charm.

This revision is now accepted and ready to land.Thu, Sep 5, 1:41 PM

Does it work when the older KIO is installed?

meven added a comment.Thu, Sep 5, 2:15 PM

Does it work when the older KIO is installed?

Yes, I have tested it.

archive/sevenz.protocol
3

Was it possible to use 7zip as protocol, it would probably be more user intuitive.

meven requested changes to this revision.Thu, Sep 5, 2:17 PM
This revision now requires changes to proceed.Thu, Sep 5, 2:17 PM
nhiga added a comment.Thu, Sep 5, 2:30 PM

@meven

There is a weird bug if I name the protocol as "7z" or "7zip":

  1. If I double click on the 7z file, Dolphin gives the "invalid protocol" error.
  2. If I try to manually enter the URL in Dolphin, i.e. 7z:/tmp/bar.7z or 7zip:/tmp/bar.7z, it does not work too - it is somehow being treated as a host (hostname) instead of a protocol.

I suspect that a KIO protocol should not have a name that starts with a number, otherwise there will be bugs.

@meven

There is a weird bug if I name the protocol as "7z" or "7zip":

  1. If I double click on the 7z file, Dolphin gives the "invalid protocol" error.
  2. If I try to manually enter the URL in Dolphin, i.e. 7z:/tmp/bar.7z or 7zip:/tmp/bar.7z, it does not work too - it is somehow being treated as a host (hostname) instead of a protocol.

    I suspect that a KIO protocol should not have a name that starts with a number, otherwise there will be bugs.

Sounds like we should fix that.

meven accepted this revision.Sat, Sep 7, 9:37 PM

7zip:/ is in fact not correct because this would make the url scheme 7zip, but a url scheme must begin with a letter .
That's too bad URL aren't not more flexible.

This revision is now accepted and ready to land.Sat, Sep 7, 9:37 PM
nhiga edited the test plan for this revision. (Show Details)Sun, Sep 8, 1:43 AM
ngraham accepted this revision.Sun, Sep 8, 10:36 PM
ngraham added reviewers: dfaure, pino, cfeck.

Yeah, I agree that the name is not 100% ideal, but honestly that's an implementation detail that shouldn't block this. The code and functionality look sound!