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:
Fawzi Mohamed
2013-05-29 14:04:33 +02:00
parent e7f9a209ea
commit 271a96b19a
9 changed files with 10 additions and 7 deletions

View File

@@ -68,7 +68,6 @@ SOURCES += \
qmljswrapinloader.cpp qmljswrapinloader.cpp
RESOURCES += qmljseditor.qrc RESOURCES += qmljseditor.qrc
OTHER_FILES += QmlJSEditor.mimetypes.xml
FORMS += \ FORMS += \
quicktoolbarsettingspage.ui \ quicktoolbarsettingspage.ui \

View File

@@ -17,7 +17,6 @@ QtcPlugin {
Depends { name: "CPlusPlus" } Depends { name: "CPlusPlus" }
files: [ files: [
"QmlJSEditor.mimetypes.xml",
"jsfilewizard.cpp", "jsfilewizard.cpp",
"jsfilewizard.h", "jsfilewizard.h",
"qmlexpressionundercursor.cpp", "qmlexpressionundercursor.cpp",

View File

@@ -1,6 +1,5 @@
<RCC> <RCC>
<qresource prefix="/qmljseditor"> <qresource prefix="/qmljseditor">
<file>QmlJSEditor.mimetypes.xml</file>
<file>images/qmlfile.png</file> <file>images/qmlfile.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@@ -53,7 +53,6 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h> #include <coreplugin/coreconstants.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/id.h> #include <coreplugin/id.h>
#include <coreplugin/fileiconprovider.h> #include <coreplugin/fileiconprovider.h>
#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actionmanager.h>
@@ -114,9 +113,6 @@ QmlJSEditorPlugin::~QmlJSEditorPlugin()
bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage) bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage)
{ {
if (!Core::ICore::mimeDatabase()->addMimeTypes(QLatin1String(":/qmljseditor/QmlJSEditor.mimetypes.xml"), errorMessage))
return false;
m_modelManager = QmlJS::ModelManagerInterface::instance(); m_modelManager = QmlJS::ModelManagerInterface::instance();
addAutoReleasedObject(new QmlJSSnippetProvider); addAutoReleasedObject(new QmlJSSnippetProvider);

View File

@@ -60,6 +60,9 @@ SOURCES += \
RESOURCES += \ RESOURCES += \
qmljstools.qrc qmljstools.qrc
OTHER_FILES += \
QmlJSTools.mimetypes.xml
FORMS += \ FORMS += \
$$PWD/qmljscodestylesettingspage.ui $$PWD/qmljscodestylesettingspage.ui

View File

@@ -20,6 +20,7 @@ QtcPlugin {
cpp.includePaths: base.concat("../../libs/3rdparty") cpp.includePaths: base.concat("../../libs/3rdparty")
files: [ files: [
"QmlJSTools.mimetypes.xml",
"qmljsbundleprovider.cpp", "qmljsbundleprovider.cpp",
"qmljsbundleprovider.h", "qmljsbundleprovider.h",
"qmljscodestylepreferencesfactory.cpp", "qmljscodestylepreferencesfactory.cpp",

View File

@@ -6,5 +6,6 @@
<file>images/log.png</file> <file>images/log.png</file>
<file>images/expand.png</file> <file>images/expand.png</file>
<file>images/error.png</file> <file>images/error.png</file>
<file>QmlJSTools.mimetypes.xml</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@@ -41,6 +41,7 @@
#include <coreplugin/coreconstants.h> #include <coreplugin/coreconstants.h>
#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/progressmanager/progressmanager.h> #include <coreplugin/progressmanager/progressmanager.h>
#include <QtPlugin> #include <QtPlugin>
@@ -72,6 +73,10 @@ bool QmlJSToolsPlugin::initialize(const QStringList &arguments, QString *error)
Q_UNUSED(arguments) Q_UNUSED(arguments)
Q_UNUSED(error) 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 m_settings = new QmlJSToolsSettings(this); // force registration of qmljstools settings
// Objects // Objects