MimeDatabase: Never use installed mime data.

It gets in the way, e.g. "No plugin can open project type "application/
x-kicad-project"" when trying to open .pro files.

Change-Id: I5d8dcb52b65b1e617fe0c6dfcdc94e2cf8fc5f5d
Reviewed-by: Tim Sander <tim@krieglstein.org>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Eike Ziller
2015-02-17 16:39:29 +01:00
parent 0e39023cb0
commit 4f5f5d75b4

View File

@@ -832,27 +832,27 @@ void MimeXMLProvider::setMagicRulesForMimeType(const MimeType &mimeType, const Q
void MimeXMLProvider::ensureLoaded() void MimeXMLProvider::ensureLoaded()
{ {
if (!m_loaded /*|| shouldCheck()*/) { if (!m_loaded /*|| shouldCheck()*/) {
bool fdoXmlFound = false; // bool fdoXmlFound = false;
QStringList allFiles; QStringList allFiles;
const QStringList packageDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime/packages"), QStandardPaths::LocateDirectory); // const QStringList packageDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime/packages"), QStandardPaths::LocateDirectory);
//qDebug() << "packageDirs=" << packageDirs; // //qDebug() << "packageDirs=" << packageDirs;
foreach (const QString &packageDir, packageDirs) { // foreach (const QString &packageDir, packageDirs) {
QDir dir(packageDir); // QDir dir(packageDir);
const QStringList files = dir.entryList(QDir::Files | QDir::NoDotAndDotDot); // const QStringList files = dir.entryList(QDir::Files | QDir::NoDotAndDotDot);
//qDebug() << static_cast<const void *>(this) << Q_FUNC_INFO << packageDir << files; // //qDebug() << static_cast<const void *>(this) << Q_FUNC_INFO << packageDir << files;
if (!fdoXmlFound) // if (!fdoXmlFound)
fdoXmlFound = files.contains(QLatin1String("freedesktop.org.xml")); // fdoXmlFound = files.contains(QLatin1String("freedesktop.org.xml"));
QStringList::const_iterator endIt(files.constEnd()); // QStringList::const_iterator endIt(files.constEnd());
for (QStringList::const_iterator it(files.constBegin()); it != endIt; ++it) { // for (QStringList::const_iterator it(files.constBegin()); it != endIt; ++it) {
allFiles.append(packageDir + QLatin1Char('/') + *it); // allFiles.append(packageDir + QLatin1Char('/') + *it);
} // }
} // }
if (!fdoXmlFound) { // if (!fdoXmlFound) {
// We could instead install the file as part of installing Qt? // // We could instead install the file as part of installing Qt?
allFiles.prepend(QLatin1String(":/qt-project.org/qmime/freedesktop.org.xml")); allFiles.prepend(QLatin1String(":/qt-project.org/qmime/freedesktop.org.xml"));
} // }
allFiles.append(m_additionalFiles); allFiles.append(m_additionalFiles);