summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2023-04-13 03:26:13 +0200
committerAhmad Samir <a.samirh78@gmail.com>2023-05-07 14:29:17 +0300
commit9547ef58c707a11d5affcbcfa553f3aca5334087 (patch)
tree2711f49ff2a8842b8dc636eb9a2733372a917434 /tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h
parenta2551c45d496c23045eb8451e080e75b2f8b42c1 (diff)
QMimeDatabase: handle glob-deleteall tags
According to the Freedesktop spec[1], a mimetype that has glob-deleteall overwrites other glob-pattern definitions for a mimetype if it is in a higher precedence dir, the default order is (from high to low) ~/.local/share/mime, /usr/local/share/mime, /usr/share/mime. Or if the XDG_DATA_DIRS env var is set, then it takes precedence. The QMime*ProviderS in m_providers are constructed/stored in that same order, high to low). For QMimeXMLProvider, we can just clear the glob patterns associated with those mimetypes from the lists/maps. For the QMimeBinaryProvider however, we can't change the binary (mmap'ed) cache file, instead check mimetype names against the exclusion list before modifying a QMimeGlobMatchResult. [1] https://specifications.freedesktop.org/shared-mime-info-spec/latest/ar01s02.html This test uses XDG_DATA_DIRS so only viable when USE_XDG_DATA_DIRS is defined. Fixes: QTBUG-101755 Pick-to: 6.5 Change-Id: Icadbdf1027155296377c5a6ab3be8e41b6668325 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h')
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h
index 8a4d8ef124..adca5ffc14 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h
@@ -25,6 +25,7 @@ private slots:
void mimeTypeForFileName();
void mimeTypesForFileName_data();
void mimeTypesForFileName();
+ void mimeTypesForFileName_glob_deleteall();
void inheritance();
void aliases();
void listAliases_data();