Commit 5a8d21d5 authored by Natsumi Higa's avatar Natsumi Higa Committed by Albert Astals Cid

Add support for cb7 comic book archives

Test Plan: Open a cb7 file (e.g. [[ https://bugs.kde.org/attachment.cgi?id=122002 | Attachment 122002 ]] from [[ https://bugs.kde.org/show_bug.cgi?id=410696 | Bug 410696 ]]) using Okular and see if it works.

Reviewers: #okular, aacid

Subscribers: broulik, pino, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D23037
parent f7e9f10d
......@@ -18,6 +18,7 @@
#include <QMimeDatabase>
#include <kzip.h>
#include <ktar.h>
#include <k7zip.h>
#include <memory>
......@@ -75,6 +76,15 @@ bool Document::open( const QString &fileName )
mime.inherits( QStringLiteral("application/x-tar") ) || mime.inherits( QStringLiteral("application/x-bzip") ) ) {
mArchive = new KTar( fileName );
if ( !processArchive() ) {
return false;
}
/**
* We have a 7z archive
*/
} else if ( mime.inherits( QStringLiteral("application/x-cb7") ) || mime.inherits( QStringLiteral("application/x-7z-compressed") ) ) {
mArchive = new K7Zip( fileName );
if ( !processArchive() ) {
return false;
}
......
......@@ -116,6 +116,7 @@
"application/x-cbz",
"application/x-cbr",
"application/x-cbt",
"application/x-cb7",
"inode/directory"
],
"Name": "ComicBook Backend",
......
[Desktop Entry]
MimeType=application/x-cbz;application/x-cbr;application/x-cbt;
MimeType=application/x-cbz;application/x-cbr;application/x-cbt;application/x-cb7;
Terminal=false
Name=Okular
Name[ar]=اوكلار
......@@ -165,7 +165,7 @@ Type=Application
InitialPreference=7
Categories=Qt;KDE;Graphics;Viewer;
NoDisplay=true
X-KDE-Keywords=cbr, cbz, cbt, Comic Book
X-KDE-Keywords=cbr, cbz, cbt, cb7, Comic Book
X-KDE-Keywords[ar]=cbr, cbz, cbt, Comic Book
X-KDE-Keywords[bg]=cbr, cbz, cbt, Comic Book
X-KDE-Keywords[bs]=cbr, cbz, cbt, Comic Book,stripovi
......
......@@ -62,4 +62,4 @@ Name[zh_TW]=文件檢視_Okular
X-KDE-ServiceTypes=KParts/ReadOnlyPart
X-KDE-Library=okularpart
Type=Service
MimeType=application/x-cbz;application/x-cbr;application/x-cbt;
MimeType=application/x-cbz;application/x-cbr;application/x-cbt;application/x-cb7;
[Desktop Entry]
MimeType=application/x-cbz;application/x-cbr;application/x-cbt;
MimeType=application/x-cbz;application/x-cbr;application/x-cbt;application/x-cb7;
Name=Reader
Name[ar]=التصيير
Name[bg]=Четец
......@@ -156,7 +156,7 @@ Type=Application
Categories=Qt;KDE;Graphics;Office;Viewer;
InitialPreference=2
NoDisplay=true
X-KDE-Keywords=cbr, cbz, cbt, Comic Book
X-KDE-Keywords=cbr, cbz, cbt, cb7, Comic Book
X-KDE-Keywords[ar]=cbr, cbz, cbt, Comic Book
X-KDE-Keywords[bg]=cbr, cbz, cbt, Comic Book
X-KDE-Keywords[bs]=cbr, cbz, cbt, Comic Book,stripovi
......
......@@ -78,6 +78,7 @@
<mimetype>application/x-cbr</mimetype>
<mimetype>application/x-cbz</mimetype>
<mimetype>application/x-cbt</mimetype>
<mimetype>application/x-cb7</mimetype>
</mimetypes>
<url type="homepage">https://okular.kde.org</url>
</component>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment