Cope with Qt 5.14's dropping of the MIME type DB as a resource

The copy is still present on non-Linux systems, but is not accessible as
a resource, so we must ship our own copy.

Fixes: QTCREATORBUG-22636
Change-Id: Ie7ae7616eadf4035bec6fffd15ac303c1d2badce
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Thiago Macieira
2019-06-27 15:56:45 -07:00
committed by Eike Ziller
parent bcc41909c5
commit 64d2965e29
4 changed files with 41244 additions and 10 deletions

7
src/libs/3rdparty/xdg/README vendored Normal file
View File

@@ -0,0 +1,7 @@
This contains a copy of freedesktop.org's shared-mime-info base package.
Update instructions:
curl https://people.freedesktop.org/~hadess/shared-mime-info-{VERSION}.tar.xz | \
xzcat | \
tar -xO shared-mime-info-{VERSION}/freedestop.org.xml > freedesktop.org.xml

41233
src/libs/3rdparty/xdg/freedesktop.org.xml vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -789,16 +789,9 @@ void MimeXMLProvider::ensureLoaded()
QStandardPaths::LocateFile); QStandardPaths::LocateFile);
if (allFiles.isEmpty()) { if (allFiles.isEmpty()) {
// System freedesktop.org.xml file not found, try to use the one in QtCore. // System freedsktop.org.xml file not found, use our bundled copy
// This is private API and has changed in the past: const char freedesktopOrgXml[] = ":/utils/mimetypes/freedesktop.org.xml";
// - Qt 5.11 added "package" subdir in 7a5644d6481a3c1a7416772998ca4e60c977bfbd allFiles.prepend(QLatin1String(freedesktopOrgXml));
// - Qt 5.13 added an option to not bundle it at all
const QString fdoXml5_11 = QStringLiteral(":/qt-project.org/qmime/packages/freedesktop.org.xml");
if (QFile::exists(fdoXml5_11))
allFiles << fdoXml5_11;
else
qFatal("Utils::MimeXMLProvider: could not find the system freedesktop.org.xml file "
"and QtCore does not have an accessible copy.");
} }
m_nameMimeTypeMap.clear(); m_nameMimeTypeMap.clear();

View File

@@ -223,6 +223,7 @@
<file>images/toggleprogressdetails@2x.png</file> <file>images/toggleprogressdetails@2x.png</file>
<file>images/unknownfile.png</file> <file>images/unknownfile.png</file>
<file>images/dir.png</file> <file>images/dir.png</file>
<file alias="mimetypes/freedesktop.org.xml" compression-algorithm="best">../3rdparty/xdg/freedesktop.org.xml</file>
</qresource> </qresource>
<qresource prefix="/codemodel"> <qresource prefix="/codemodel">
<file>images/enum.png</file> <file>images/enum.png</file>