forked from qt-creator/qt-creator
CMake: Fix startup warning
Accessing MimeDatabase for text/x-cmake before plugins are initialized
There is not much use for using QMimeType internally anyway, since they
are effectively only used as strings.
Amends ac2ca7244a
Change-Id: I4d7b1bb2f0ad4e857409e3ef287f5b9abe052193
Reviewed-by: Xavier BESSON <developer@xavi-b.fr>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -43,8 +43,7 @@ using namespace Utils;
|
||||
|
||||
namespace CMakeProjectManager::Internal {
|
||||
|
||||
bool isAutoFormatApplicable(const Core::IDocument *document,
|
||||
const QList<Utils::MimeType> &allowedMimeTypes)
|
||||
bool isAutoFormatApplicable(const Core::IDocument *document, const QStringList &allowedMimeTypes)
|
||||
{
|
||||
if (!document)
|
||||
return false;
|
||||
@@ -53,8 +52,8 @@ bool isAutoFormatApplicable(const Core::IDocument *document,
|
||||
return true;
|
||||
|
||||
const Utils::MimeType documentMimeType = Utils::mimeTypeForName(document->mimeType());
|
||||
return Utils::anyOf(allowedMimeTypes, [&documentMimeType](const Utils::MimeType &mime) {
|
||||
return documentMimeType.inherits(mime.name());
|
||||
return Utils::anyOf(allowedMimeTypes, [&documentMimeType](const QString &mime) {
|
||||
return documentMimeType.inherits(mime);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user