Commit 5234c775 authored by Christian Kamm's avatar Christian Kamm
Browse files

Make the QmlJSEditor work when Qml support is disabled.

- Enable qmlprojectplugin even if Qml support is disabled.
- But disable its wizards in that case.
- Disable the Qml file wizard if the support is off.

Reviewed-by: Kai Koehne
parent 11188436
...@@ -117,3 +117,9 @@ win32-msvc* { ...@@ -117,3 +117,9 @@ win32-msvc* {
# Handle S60 support: default on Windows, conditionally built on other platforms. # Handle S60 support: default on Windows, conditionally built on other platforms.
macx:SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60) macx:SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60)
else:SUPPORT_QT_S60=1 else:SUPPORT_QT_S60=1
# Define QTCREATOR_WITH_QML if building with Qml support
SUPPORT_QT_QML = $$(QTCREATOR_WITH_QML)
!isEmpty(SUPPORT_QT_QML) {
DEFINES += QTCREATOR_WITH_QML
}
...@@ -37,13 +37,11 @@ SUBDIRS = plugin_coreplugin \ ...@@ -37,13 +37,11 @@ SUBDIRS = plugin_coreplugin \
SUPPORT_QT_QML = $$(QTCREATOR_WITH_QML) SUPPORT_QT_QML = $$(QTCREATOR_WITH_QML)
!isEmpty(SUPPORT_QT_QML) { contains(QT_CONFIG, declarative) {
message("Adding support for Qt/QML projects.") SUBDIRS += plugin_qmlprojectmanager
DEFINES += QTCREATOR_WITH_QML
contains(QT_CONFIG, declarative) { !isEmpty(SUPPORT_QT_QML) {
message("Adding support for QmlDesigner, QmlInspector and Qml wizards.")
SUBDIRS += plugin_qmlprojectmanager
include(private_headers.pri) include(private_headers.pri)
exists($${QT_PRIVATE_HEADERS}/QtDeclarative/private/qdeclarativecontext_p.h) { exists($${QT_PRIVATE_HEADERS}/QtDeclarative/private/qdeclarativecontext_p.h) {
...@@ -55,8 +53,8 @@ SUPPORT_QT_QML = $$(QTCREATOR_WITH_QML) ...@@ -55,8 +53,8 @@ SUPPORT_QT_QML = $$(QTCREATOR_WITH_QML)
warning("The plugins depend on on private headers from QtDeclarative module.") warning("The plugins depend on on private headers from QtDeclarative module.")
warning("To enable them, pass 'QT_PRIVATE_HEADERS=$QTDIR/include' to qmake, where $QTDIR is the source directory of qt.") warning("To enable them, pass 'QT_PRIVATE_HEADERS=$QTDIR/include' to qmake, where $QTDIR is the source directory of qt.")
warning() warning()
} }
} }
} }
plugin_coreplugin.subdir = coreplugin plugin_coreplugin.subdir = coreplugin
......
...@@ -105,6 +105,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e ...@@ -105,6 +105,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
m_editor = new QmlJSEditorFactory(this); m_editor = new QmlJSEditorFactory(this);
addObject(m_editor); addObject(m_editor);
#ifdef QTCREATOR_WITH_QML
Core::BaseFileWizardParameters wizardParameters(Core::IWizard::FileWizard); Core::BaseFileWizardParameters wizardParameters(Core::IWizard::FileWizard);
wizardParameters.setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT)); wizardParameters.setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
wizardParameters.setDisplayCategory(QCoreApplication::translate("Core", Core::Constants::WIZARD_TR_CATEGORY_QT)); wizardParameters.setDisplayCategory(QCoreApplication::translate("Core", Core::Constants::WIZARD_TR_CATEGORY_QT));
...@@ -112,6 +113,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e ...@@ -112,6 +113,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
wizardParameters.setDisplayName(tr("Qt QML File")); wizardParameters.setDisplayName(tr("Qt QML File"));
wizardParameters.setId(QLatin1String("Q.Qml")); wizardParameters.setId(QLatin1String("Q.Qml"));
addAutoReleasedObject(new QmlFileWizard(wizardParameters, core)); addAutoReleasedObject(new QmlFileWizard(wizardParameters, core));
#endif
m_actionHandler = new TextEditor::TextEditorActionHandler(QmlJSEditor::Constants::C_QMLJSEDITOR_ID, m_actionHandler = new TextEditor::TextEditorActionHandler(QmlJSEditor::Constants::C_QMLJSEDITOR_ID,
TextEditor::TextEditorActionHandler::Format TextEditor::TextEditorActionHandler::Format
......
...@@ -82,8 +82,10 @@ bool QmlProjectPlugin::initialize(const QStringList &, QString *errorMessage) ...@@ -82,8 +82,10 @@ bool QmlProjectPlugin::initialize(const QStringList &, QString *errorMessage)
addAutoReleasedObject(manager); addAutoReleasedObject(manager);
addAutoReleasedObject(new Internal::QmlProjectRunConfigurationFactory); addAutoReleasedObject(new Internal::QmlProjectRunConfigurationFactory);
addAutoReleasedObject(new Internal::QmlRunControlFactory); addAutoReleasedObject(new Internal::QmlRunControlFactory);
#ifdef QTCREATOR_WITH_QML
addAutoReleasedObject(new QmlProjectApplicationWizard); addAutoReleasedObject(new QmlProjectApplicationWizard);
addAutoReleasedObject(new QmlProjectImportWizard); addAutoReleasedObject(new QmlProjectImportWizard);
#endif
QmlProjectFileFormat::registerDeclarativeTypes(); QmlProjectFileFormat::registerDeclarativeTypes();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment