mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-27 11:40:07 +00:00
Fine tune opening files
If we're going to set triedMimeFromFileContent to true we need to actually try the contents and not the extension. This is a KF5 porting mistake
This commit is contained in:
parent
ccb19c681d
commit
caf52d0ed9
|
@ -2416,7 +2416,7 @@ Document::OpenResult Document::openDocument(const QString & docFile, const QUrl
|
|||
KPluginMetaData offer = DocumentPrivate::generatorForMimeType(mime, d->m_widget);
|
||||
if ( !offer.isValid() && !triedMimeFromFileContent )
|
||||
{
|
||||
QMimeType newmime = db.mimeTypeForFile(docFile, QMimeDatabase::MatchExtension);
|
||||
QMimeType newmime = db.mimeTypeForFile(docFile, QMimeDatabase::MatchContent);
|
||||
triedMimeFromFileContent = true;
|
||||
if ( newmime != mime )
|
||||
{
|
||||
|
@ -2466,7 +2466,7 @@ Document::OpenResult Document::openDocument(const QString & docFile, const QUrl
|
|||
|
||||
if (openResult == OpenError && !triedMimeFromFileContent )
|
||||
{
|
||||
QMimeType newmime = db.mimeTypeForFile(docFile, QMimeDatabase::MatchExtension);
|
||||
QMimeType newmime = db.mimeTypeForFile(docFile, QMimeDatabase::MatchContent);
|
||||
triedMimeFromFileContent = true;
|
||||
if ( newmime != mime )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue