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 /tests/auto/corelib | |
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 'tests/auto/corelib')
-rw-r--r-- | tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp index 5ca89c7dc1..1c2597a1f2 100644 --- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp +++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp @@ -985,11 +985,10 @@ void tst_QMimeDatabase::installNewGlobalMimeType() QCOMPARE(db.mimeTypeForFile(qmlTestFile).name(), QString::fromLatin1("text/x-qml")); - // ensure we can access the empty glob list { QMimeType objcsrc = db.mimeTypeForName(QStringLiteral("text/x-objcsrc")); QVERIFY(objcsrc.isValid()); - qDebug() << objcsrc.globPatterns(); + QCOMPARE(objcsrc.globPatterns(), QStringList()); } const QString fooTestFile = QLatin1String(RESOURCE_PREFIX "magic-and-hierarchy.foo"); @@ -1066,6 +1065,12 @@ void tst_QMimeDatabase::installNewLocalMimeType() QCOMPARE(db.mimeTypeForName(QLatin1String("text/x-SuSE-ymu")).comment(), QString("URL of a YaST Meta Package")); checkHasMimeType("text/x-suse-ymp"); + { // QTBUG-85436 + QMimeType objcsrc = db.mimeTypeForName(QStringLiteral("text/x-objcsrc")); + QVERIFY(objcsrc.isValid()); + QCOMPARE(objcsrc.globPatterns(), QStringList()); + } + // Test that a double-definition of a mimetype doesn't lead to sniffing ("conflicting globs"). const QString qmlTestFile = QLatin1String(RESOURCE_PREFIX "test.qml"); QVERIFY2(!qmlTestFile.isEmpty(), |