mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-24 02:42:52 +00:00
okular: use KMimeType::is() instead of MIME name comparison in comic book generator
fixes opening of comic books which MIME type is alias Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
2f4065ac46
commit
2869d91781
1 changed files with 5 additions and 4 deletions
|
@ -56,10 +56,11 @@ bool Document::open( const QString &fileName )
|
||||||
|
|
||||||
const KMimeType::Ptr mime = KMimeType::findByFileContent( fileName );
|
const KMimeType::Ptr mime = KMimeType::findByFileContent( fileName );
|
||||||
|
|
||||||
|
// qDebug() << Q_FUNC_INFO << mime->name();
|
||||||
/**
|
/**
|
||||||
* We have a zip archive
|
* We have a zip archive
|
||||||
*/
|
*/
|
||||||
if ( mime->is( "application/x-cbz" ) || mime->name() == "application/zip" ) {
|
if ( mime->is( "application/x-cbz" ) || mime->is( "application/zip" ) ) {
|
||||||
mArchive = new KZip( fileName );
|
mArchive = new KZip( fileName );
|
||||||
|
|
||||||
if ( !processArchive() ) {
|
if ( !processArchive() ) {
|
||||||
|
@ -68,14 +69,14 @@ bool Document::open( const QString &fileName )
|
||||||
/**
|
/**
|
||||||
* We have a TAR archive
|
* We have a TAR archive
|
||||||
*/
|
*/
|
||||||
} else if ( mime->is( "application/x-cbt" ) || mime->name() == "application/x-gzip" ||
|
} else if ( mime->is( "application/x-cbt" ) || mime->is( "application/x-gzip" ) ||
|
||||||
mime->name() == "application/x-tar" || mime->name() == "application/x-bzip" ) {
|
mime->is( "application/x-tar" ) || mime->is( "application/x-bzip" ) ) {
|
||||||
mArchive = new KTar( fileName );
|
mArchive = new KTar( fileName );
|
||||||
|
|
||||||
if ( !processArchive() ) {
|
if ( !processArchive() ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if ( mime->is( "application/x-cbr" ) || mime->name() == "application/x-rar" ) {
|
} else if ( mime->is( "application/x-cbr" ) || mime->is( "application/x-rar" ) ) {
|
||||||
if ( !Unrar::isAvailable() ) {
|
if ( !Unrar::isAvailable() ) {
|
||||||
mLastErrorString = i18n( "Cannot open document, unrar was not found." );
|
mLastErrorString = i18n( "Cannot open document, unrar was not found." );
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue