diff options
author | David Faure <david.faure@kdab.com> | 2016-12-26 13:46:40 +0100 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2016-12-27 11:33:03 +0000 |
commit | 6722147696c7ba603d24163498a3f7de76ad6cea (patch) | |
tree | ad1021c3b6e0528a1820a81ff041f30445294bcd /src/corelib/mimetypes/qmimedatabase_p.h | |
parent | f163912b5d577705c3d42428b0af75222f84b761 (diff) |
QMimeDatabase: fix handling of conflicting globs
This code always intended to follow the recommended checking order from
the spec, which says "if multiple globs match, use file contents".
But if the globs had different weights, it would discard globs with
lower weights, and then wrongly conclude, if there is only one glob
left, that there was no ambiguity.
The correct way is rather: remember that multiple globs matched,
do determination from contents, and if that didn't work, *then* use
(one of) the highest-weight glob(s).
This fixes PGP-encrypted *.asc files being detected as text/plain rather
than application/pgp-encrypted.
(https://bugs.kde.org/show_bug.cgi?id=346754)
Change-Id: I734459daf9f502baa95ebb89432819964e0ce304
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/mimetypes/qmimedatabase_p.h')
-rw-r--r-- | src/corelib/mimetypes/qmimedatabase_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/mimetypes/qmimedatabase_p.h b/src/corelib/mimetypes/qmimedatabase_p.h index 4ff5110a5b..3f63f5f103 100644 --- a/src/corelib/mimetypes/qmimedatabase_p.h +++ b/src/corelib/mimetypes/qmimedatabase_p.h @@ -90,7 +90,7 @@ public: QMimeType mimeTypeForName(const QString &nameOrAlias); QMimeType mimeTypeForFileNameAndData(const QString &fileName, QIODevice *device, int *priorityPtr); QMimeType findByData(const QByteArray &data, int *priorityPtr); - QStringList mimeTypeForFileName(const QString &fileName, QString *foundSuffix = 0); + QStringList mimeTypeForFileName(const QString &fileName); mutable QMimeProviderBase *m_provider; const QString m_defaultMimeType; |