Changeset View
Changeset View
Standalone View
Standalone View
generators/comicbook/document.cpp
Show All 12 Lines | |||||
13 | #include <QImage> | 13 | #include <QImage> | ||
14 | #include <QImageReader> | 14 | #include <QImageReader> | ||
15 | 15 | | |||
16 | #include <KLocalizedString> | 16 | #include <KLocalizedString> | ||
17 | #include <QMimeType> | 17 | #include <QMimeType> | ||
18 | #include <QMimeDatabase> | 18 | #include <QMimeDatabase> | ||
19 | #include <kzip.h> | 19 | #include <kzip.h> | ||
20 | #include <ktar.h> | 20 | #include <ktar.h> | ||
21 | #include <k7zip.h> | ||||
21 | 22 | | |||
22 | #include <memory> | 23 | #include <memory> | ||
23 | 24 | | |||
24 | #include <core/page.h> | 25 | #include <core/page.h> | ||
25 | 26 | | |||
26 | #include "debug_comicbook.h" | 27 | #include "debug_comicbook.h" | ||
27 | #include "directory.h" | 28 | #include "directory.h" | ||
28 | #include "qnatsort.h" | 29 | #include "qnatsort.h" | ||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | 57 | { | |||
73 | */ | 74 | */ | ||
74 | } else if ( mime.inherits( QStringLiteral("application/x-cbt") ) || mime.inherits( QStringLiteral("application/x-gzip") ) || | 75 | } else if ( mime.inherits( QStringLiteral("application/x-cbt") ) || mime.inherits( QStringLiteral("application/x-gzip") ) || | ||
75 | mime.inherits( QStringLiteral("application/x-tar") ) || mime.inherits( QStringLiteral("application/x-bzip") ) ) { | 76 | mime.inherits( QStringLiteral("application/x-tar") ) || mime.inherits( QStringLiteral("application/x-bzip") ) ) { | ||
76 | mArchive = new KTar( fileName ); | 77 | mArchive = new KTar( fileName ); | ||
77 | 78 | | |||
78 | if ( !processArchive() ) { | 79 | if ( !processArchive() ) { | ||
79 | return false; | 80 | return false; | ||
80 | } | 81 | } | ||
82 | /** | ||||
83 | * We have a 7z archive | ||||
84 | */ | ||||
85 | } else if ( mime.inherits( QStringLiteral("application/x-cb7") ) || mime.inherits( QStringLiteral("application/x-7z-compressed") ) ) { | ||||
86 | mArchive = new K7Zip( fileName ); | ||||
87 | | ||||
88 | if ( !processArchive() ) { | ||||
89 | return false; | ||||
90 | } | ||||
81 | } else if ( mime.inherits( QStringLiteral("application/x-cbr") ) || mime.inherits( QStringLiteral("application/x-rar") ) || mime.inherits( QStringLiteral("application/vnd.rar") ) ) { | 91 | } else if ( mime.inherits( QStringLiteral("application/x-cbr") ) || mime.inherits( QStringLiteral("application/x-rar") ) || mime.inherits( QStringLiteral("application/vnd.rar") ) ) { | ||
82 | if ( !Unrar::isAvailable() ) { | 92 | if ( !Unrar::isAvailable() ) { | ||
83 | mLastErrorString = i18n( "Cannot open document, neither unrar nor unarchiver were found." ); | 93 | mLastErrorString = i18n( "Cannot open document, neither unrar nor unarchiver were found." ); | ||
84 | return false; | 94 | return false; | ||
85 | } | 95 | } | ||
86 | 96 | | |||
87 | if ( !Unrar::isSuitableVersionAvailable() ) { | 97 | if ( !Unrar::isSuitableVersionAvailable() ) { | ||
88 | mLastErrorString = i18n( "The version of unrar on your system is not suitable for opening comicbooks." ); | 98 | mLastErrorString = i18n( "The version of unrar on your system is not suitable for opening comicbooks." ); | ||
▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines |