forked from qt-creator/qt-creator
qmljs: moving all mime types into qmljstools
This reduces uneeded dependencies for modules that need the types like the qbs module. Change-Id: I59a6067a4c24a6d0401bf57fdfa8f5dc1f03595c Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
42
src/plugins/qmljstools/QmlJSTools.mimetypes.xml
Normal file
42
src/plugins/qmljstools/QmlJSTools.mimetypes.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0"?>
|
||||
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
|
||||
<mime-type type="application/x-qml">
|
||||
<alias type="text/x-qml"/>
|
||||
<sub-class-of type="text/plain"/>
|
||||
<comment>QML file</comment>
|
||||
<glob pattern="*.qml"/>
|
||||
</mime-type>
|
||||
<mime-type type="application/x-qt.qbs+qml">
|
||||
<alias type="text/x-qt.qbs+qml"/>
|
||||
<sub-class-of type="application/x-qml"/>
|
||||
<comment>Qt Build Suite file</comment>
|
||||
<glob pattern="*.qbs"/>
|
||||
</mime-type>
|
||||
<mime-type type="application/x-qmlproject">
|
||||
<alias type="text/x-qmlproject"/>
|
||||
<sub-class-of type="application/x-qml"/>
|
||||
<comment>Qt Creator Qt UI project file</comment>
|
||||
<glob pattern="*.qmlproject"/>
|
||||
</mime-type>
|
||||
<mime-type type="application/x-qt.meta-info+qml">
|
||||
<alias type="text/x-qt.meta-info+qml"/>
|
||||
<sub-class-of type="application/x-qml"/>
|
||||
<comment>QML file</comment>
|
||||
<glob pattern="*.qmltypes"/>
|
||||
</mime-type>
|
||||
<mime-type type="application/javascript">
|
||||
<alias type="application/x-javascript"/>
|
||||
<alias type="text/javascript"/>
|
||||
<alias type="text/x-javascript"/>
|
||||
<sub-class-of type="text/plain"/>
|
||||
<comment>Qt Script file</comment>
|
||||
<glob pattern="*.js"/>
|
||||
<glob pattern="*.qs"/>
|
||||
<glob pattern="*.qtt"/>
|
||||
</mime-type>
|
||||
<mime-type type="application/json">
|
||||
<sub-class-of type="text/plain"/>
|
||||
<comment>JSON file</comment>
|
||||
<glob pattern="*.json"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
@@ -60,6 +60,9 @@ SOURCES += \
|
||||
RESOURCES += \
|
||||
qmljstools.qrc
|
||||
|
||||
OTHER_FILES += \
|
||||
QmlJSTools.mimetypes.xml
|
||||
|
||||
FORMS += \
|
||||
$$PWD/qmljscodestylesettingspage.ui
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ QtcPlugin {
|
||||
cpp.includePaths: base.concat("../../libs/3rdparty")
|
||||
|
||||
files: [
|
||||
"QmlJSTools.mimetypes.xml",
|
||||
"qmljsbundleprovider.cpp",
|
||||
"qmljsbundleprovider.h",
|
||||
"qmljscodestylepreferencesfactory.cpp",
|
||||
|
||||
@@ -6,5 +6,6 @@
|
||||
<file>images/log.png</file>
|
||||
<file>images/expand.png</file>
|
||||
<file>images/error.png</file>
|
||||
<file>QmlJSTools.mimetypes.xml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
|
||||
#include <QtPlugin>
|
||||
@@ -72,6 +73,10 @@ bool QmlJSToolsPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
Q_UNUSED(arguments)
|
||||
Q_UNUSED(error)
|
||||
|
||||
if (!Core::ICore::mimeDatabase()
|
||||
->addMimeTypes(QLatin1String(":/qmljstools/QmlJSTools.mimetypes.xml"), error))
|
||||
return false;
|
||||
|
||||
m_settings = new QmlJSToolsSettings(this); // force registration of qmljstools settings
|
||||
|
||||
// Objects
|
||||
|
||||
Reference in New Issue
Block a user