Do yet another attempt at finding the correct mimetype

Makes
okular http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/products/digital-editions/assets/welcome.epub
work
remotes/origin/KDE/4.10
Albert Astals Cid 13 years ago
parent a6d53df7ac
commit 2abe5fa9ef
  1. 12
      core/document.cpp

@ -1859,6 +1859,18 @@ bool Document::openDocument( const QString & docFile, const KUrl& url, const KMi
mime = newmime;
offers = KMimeTypeTrader::self()->query( mime->name(), "okular/Generator", constraint );
}
if ( offers.isEmpty() )
{
// There's still no offers, do a final mime search based on the filename
// We need this becuase sometimes (e.g. when downloading from a webserver) the mimetype we
// use is the one feeded by the server, that may be wrong
newmime = KMimeType::findByUrl( docFile );
if ( newmime->name() != mime->name() )
{
mime = newmime;
offers = KMimeTypeTrader::self()->query( mime->name(), "okular/Generator", constraint );
}
}
}
if (offers.isEmpty())
{

Loading…
Cancel
Save