forked from qt-creator/qt-creator
Mimetypes v3: 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. Mostly relevant on
Linux, where mime data is actually installed system-wide.
Re-implements 4f5f5d75b4
Change-Id: Ifd34214b99b77720cfc6d22e6702ca6e9ba513dc
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -101,8 +101,13 @@ bool MimeDatabasePrivate::shouldCheck()
|
|||||||
|
|
||||||
void MimeDatabasePrivate::loadProviders()
|
void MimeDatabasePrivate::loadProviders()
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
// We use QStandardPaths every time to check if new files appeared
|
// We use QStandardPaths every time to check if new files appeared
|
||||||
const QStringList mimeDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime"), QStandardPaths::LocateDirectory);
|
const QStringList mimeDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime"), QStandardPaths::LocateDirectory);
|
||||||
|
#else
|
||||||
|
// Qt Creator never uses the standard paths, they can conflict with our setup
|
||||||
|
const QStringList mimeDirs;
|
||||||
|
#endif
|
||||||
const auto fdoIterator = std::find_if(mimeDirs.constBegin(), mimeDirs.constEnd(), [](const QString &mimeDir) -> bool {
|
const auto fdoIterator = std::find_if(mimeDirs.constBegin(), mimeDirs.constEnd(), [](const QString &mimeDir) -> bool {
|
||||||
return QFileInfo::exists(mimeDir + QStringLiteral("/packages/freedesktop.org.xml")); }
|
return QFileInfo::exists(mimeDir + QStringLiteral("/packages/freedesktop.org.xml")); }
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user