From fc8f5afc874073f91d3770273e0a9164182d7897 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 11 Sep 2020 10:05:51 +0200 Subject: 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 --- src/corelib/mimetypes/qmimeprovider.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/corelib/mimetypes/qmimeprovider.cpp') 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('*'))) { -- cgit v1.2.3