summaryrefslogtreecommitdiffstats
path: root/src/corelib/mimetypes/qmimedatabase_p.h
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2023-09-12 23:26:47 +0200
committerDavid Faure <david.faure@kdab.com>2023-09-13 13:45:04 +0200
commit4e9944e6c8a456353d243ab268cb0f01ff006faa (patch)
tree688c3cde3f6247ddadb73823e188a67624de3eb8 /src/corelib/mimetypes/qmimedatabase_p.h
parent994311a66bd31983bec5d75d87f5e03f53f14def (diff)
QMimeDatabase: collect glob patterns from all locations
A QMimeTypePrivate used to belong to a single provider, which would provide the complete data for it. But since the redesign in commit 7a5644d6481a3c1a741677, each provider represents is a single mime directory, and the merging happens at the QMimeDatabase level. So we need a QMimeType[Private] to be just a name (a "request" for information about this mimetype) and the information for that mimetype is retrieved on demand by querying the providers and either stopping at the first one (e.g. for icons) or merging the data from all of them (e.g. for glob patterns). The XML provider was using QMimeTypePrivate as data storage, give it its own struct QMimeTypeXMLData for that purpose instead. Task-number: QTBUG-116905 Change-Id: Ia0e0d94aa899720dc0b908f40c25317473005af4 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.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/corelib/mimetypes/qmimedatabase_p.h b/src/corelib/mimetypes/qmimedatabase_p.h
index 96981ba3fe..cb28f0b791 100644
--- a/src/corelib/mimetypes/qmimedatabase_p.h
+++ b/src/corelib/mimetypes/qmimedatabase_p.h
@@ -66,9 +66,10 @@ public:
QMimeGlobMatchResult findByFileName(const QString &fileName);
// API for QMimeType. Takes care of locking the mutex.
- void loadMimeTypePrivate(QMimeTypePrivate &mimePrivate);
- void loadGenericIcon(QMimeTypePrivate &mimePrivate);
- void loadIcon(QMimeTypePrivate &mimePrivate);
+ QMimeTypePrivate::LocaleHash localeComments(const QString &name);
+ QStringList globPatterns(const QString &name);
+ QString genericIcon(const QString &name);
+ QString icon(const QString &name);
QStringList mimeParents(const QString &mimeName);
QStringList listAliases(const QString &mimeName);
bool mimeInherits(const QString &mime, const QString &parent);
@@ -81,7 +82,7 @@ private:
QString fallbackParent(const QString &mimeTypeName) const;
const QString m_defaultMimeType;
- mutable Providers m_providers;
+ mutable Providers m_providers; // most local first, most global last
QElapsedTimer m_lastCheck;
public: