diff options
author | David Faure <david.faure@kdab.com> | 2020-09-11 10:05:51 +0200 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2020-09-22 20:40:45 +0200 |
commit | fc8f5afc874073f91d3770273e0a9164182d7897 (patch) | |
tree | 8cfd33f885ac7ee09d3e38bc18cdc343f435646b /src/corelib/mimetypes/qmimeprovider.cpp | |
parent | ad9108e2e96ebf67147a72a7dab00398ff637695 (diff) |
QMimeDatabase: fix handling of glob-deleteall
Binary provider:
It was not possible to remove the first glob in a local override,
because the mainPattern handling would re-add the first glob back.
XML provider:
It didn't support glob-deleteall.
Also, the order of the providers was wrong. We want to pick local
overrides first, the internal DB has to go last in the list.
Fixes: QTBUG-85436
Pick-to: 5.15
Change-Id: I9a4523f37cd962c730df9a6ed992bd01c075bf03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/mimetypes/qmimeprovider.cpp')
-rw-r--r-- | src/corelib/mimetypes/qmimeprovider.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp index 7a6c522a9d..fcc6cdf088 100644 --- a/src/corelib/mimetypes/qmimeprovider.cpp +++ b/src/corelib/mimetypes/qmimeprovider.cpp @@ -542,6 +542,7 @@ void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data) data.iconName = xml.attributes().value(QLatin1String("name")).toString(); } else if (tag == QLatin1String("glob-deleteall")) { // as written out by shared-mime-info >= 0.70 data.globPatterns.clear(); + mainPattern.clear(); } else if (tag == QLatin1String("glob")) { // as written out by shared-mime-info >= 0.70 const QString pattern = xml.attributes().value(QLatin1String("pattern")).toString(); if (mainPattern.isEmpty() && pattern.startsWith(QLatin1Char('*'))) { |