From 271a96b19a17083d2cd7d2350aa83d3c11b462d3 Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Wed, 29 May 2013 14:04:33 +0200 Subject: [PATCH] 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 Reviewed-by: Tobias Hunger Reviewed-by: Orgad Shaneh --- src/plugins/qmljseditor/qmljseditor.pro | 1 - src/plugins/qmljseditor/qmljseditor.qbs | 1 - src/plugins/qmljseditor/qmljseditor.qrc | 1 - src/plugins/qmljseditor/qmljseditorplugin.cpp | 4 ---- .../QmlJSTools.mimetypes.xml} | 0 src/plugins/qmljstools/qmljstools.pro | 3 +++ src/plugins/qmljstools/qmljstools.qbs | 1 + src/plugins/qmljstools/qmljstools.qrc | 1 + src/plugins/qmljstools/qmljstoolsplugin.cpp | 5 +++++ 9 files changed, 10 insertions(+), 7 deletions(-) rename src/plugins/{qmljseditor/QmlJSEditor.mimetypes.xml => qmljstools/QmlJSTools.mimetypes.xml} (100%) diff --git a/src/plugins/qmljseditor/qmljseditor.pro b/src/plugins/qmljseditor/qmljseditor.pro index d6201be0523..9a40aa33eae 100644 --- a/src/plugins/qmljseditor/qmljseditor.pro +++ b/src/plugins/qmljseditor/qmljseditor.pro @@ -68,7 +68,6 @@ SOURCES += \ qmljswrapinloader.cpp RESOURCES += qmljseditor.qrc -OTHER_FILES += QmlJSEditor.mimetypes.xml FORMS += \ quicktoolbarsettingspage.ui \ diff --git a/src/plugins/qmljseditor/qmljseditor.qbs b/src/plugins/qmljseditor/qmljseditor.qbs index 32d3ef4d359..72c9294c143 100644 --- a/src/plugins/qmljseditor/qmljseditor.qbs +++ b/src/plugins/qmljseditor/qmljseditor.qbs @@ -17,7 +17,6 @@ QtcPlugin { Depends { name: "CPlusPlus" } files: [ - "QmlJSEditor.mimetypes.xml", "jsfilewizard.cpp", "jsfilewizard.h", "qmlexpressionundercursor.cpp", diff --git a/src/plugins/qmljseditor/qmljseditor.qrc b/src/plugins/qmljseditor/qmljseditor.qrc index 38e57bac808..35ecba5f6ee 100644 --- a/src/plugins/qmljseditor/qmljseditor.qrc +++ b/src/plugins/qmljseditor/qmljseditor.qrc @@ -1,6 +1,5 @@ - QmlJSEditor.mimetypes.xml images/qmlfile.png diff --git a/src/plugins/qmljseditor/qmljseditorplugin.cpp b/src/plugins/qmljseditor/qmljseditorplugin.cpp index 21044644d23..afaafd6c331 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.cpp +++ b/src/plugins/qmljseditor/qmljseditorplugin.cpp @@ -53,7 +53,6 @@ #include #include -#include #include #include #include @@ -114,9 +113,6 @@ QmlJSEditorPlugin::~QmlJSEditorPlugin() 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(); addAutoReleasedObject(new QmlJSSnippetProvider); diff --git a/src/plugins/qmljseditor/QmlJSEditor.mimetypes.xml b/src/plugins/qmljstools/QmlJSTools.mimetypes.xml similarity index 100% rename from src/plugins/qmljseditor/QmlJSEditor.mimetypes.xml rename to src/plugins/qmljstools/QmlJSTools.mimetypes.xml diff --git a/src/plugins/qmljstools/qmljstools.pro b/src/plugins/qmljstools/qmljstools.pro index 93021dd6a87..c3fdd89e7d7 100644 --- a/src/plugins/qmljstools/qmljstools.pro +++ b/src/plugins/qmljstools/qmljstools.pro @@ -60,6 +60,9 @@ SOURCES += \ RESOURCES += \ qmljstools.qrc +OTHER_FILES += \ + QmlJSTools.mimetypes.xml + FORMS += \ $$PWD/qmljscodestylesettingspage.ui diff --git a/src/plugins/qmljstools/qmljstools.qbs b/src/plugins/qmljstools/qmljstools.qbs index 682dc34de17..dc8b1f78b2c 100644 --- a/src/plugins/qmljstools/qmljstools.qbs +++ b/src/plugins/qmljstools/qmljstools.qbs @@ -20,6 +20,7 @@ QtcPlugin { cpp.includePaths: base.concat("../../libs/3rdparty") files: [ + "QmlJSTools.mimetypes.xml", "qmljsbundleprovider.cpp", "qmljsbundleprovider.h", "qmljscodestylepreferencesfactory.cpp", diff --git a/src/plugins/qmljstools/qmljstools.qrc b/src/plugins/qmljstools/qmljstools.qrc index 9e396a3995a..ab7f6f798ca 100644 --- a/src/plugins/qmljstools/qmljstools.qrc +++ b/src/plugins/qmljstools/qmljstools.qrc @@ -6,5 +6,6 @@ images/log.png images/expand.png images/error.png + QmlJSTools.mimetypes.xml diff --git a/src/plugins/qmljstools/qmljstoolsplugin.cpp b/src/plugins/qmljstools/qmljstoolsplugin.cpp index 0d2889019c0..50d76d84276 100644 --- a/src/plugins/qmljstools/qmljstoolsplugin.cpp +++ b/src/plugins/qmljstools/qmljstoolsplugin.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -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