forked from qt-creator/qt-creator
Mime types: Fix that some QML files were opened as C++
We registered a mime type "application/x-qml" conflicting with "text/x- qml" from freedesktop.org.xml. The magic matcher of the C++ mime types might kick in, in that case. Task-number: QTCREATORBUG-13994 Change-Id: I5900c233b42681d7b7d3af185d6ff3e1c4166e59 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -269,7 +269,7 @@ void QmlProjectRunConfiguration::updateEnabled()
|
||||
IDocument *document = EditorManager::currentDocument();
|
||||
if (document) {
|
||||
m_currentFileFilename = document->filePath().toString();
|
||||
if (mdb.mimeTypeForFile(mainScript()).matchesName(QLatin1String("application/x-qml")))
|
||||
if (mdb.mimeTypeForFile(mainScript()).matchesName(QLatin1String("text/x-qml")))
|
||||
qmlFileFound = true;
|
||||
}
|
||||
if (!document
|
||||
@@ -280,7 +280,7 @@ void QmlProjectRunConfiguration::updateEnabled()
|
||||
const QFileInfo fi(filename);
|
||||
|
||||
if (!filename.isEmpty() && fi.baseName()[0].isLower()
|
||||
&& mdb.mimeTypeForFile(fi).matchesName(QLatin1String("application/x-qml")))
|
||||
&& mdb.mimeTypeForFile(fi).matchesName(QLatin1String("text/x-qml")))
|
||||
{
|
||||
m_currentFileFilename = filename;
|
||||
qmlFileFound = true;
|
||||
|
||||
Reference in New Issue
Block a user