Skip to content
Snippets Groups Projects
Commit e036b011 authored by Kai Koehne's avatar Kai Koehne
Browse files

Register qml.qch file automatically in help collection

Automatically register qml.qch if found in shared/help/qtcreator.
This is needed for the special 'creator-qml' package.
parent 4c85511d
No related branches found
No related tags found
No related merge requests found
...@@ -21,5 +21,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license> ...@@ -21,5 +21,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<dependencyList> <dependencyList>
<dependency name="Core" version="1.2.93"/> <dependency name="Core" version="1.2.93"/>
<dependency name="TextEditor" version="1.2.93"/> <dependency name="TextEditor" version="1.2.93"/>
<dependency name="Help" version="1.2.93"/>
</dependencyList> </dependencyList>
</plugin> </plugin>
...@@ -47,3 +47,4 @@ SOURCES += qmleditor.cpp \ ...@@ -47,3 +47,4 @@ SOURCES += qmleditor.cpp \
qmlsymbol.cpp \ qmlsymbol.cpp \
qmlfilewizard.cpp qmlfilewizard.cpp
RESOURCES += qmleditor.qrc RESOURCES += qmleditor.qrc
OTHER_FILES += QmlEditor.pluginspec
include(../../plugins/coreplugin/coreplugin.pri) include(../../plugins/coreplugin/coreplugin.pri)
include(../../plugins/texteditor/texteditor.pri) include(../../plugins/texteditor/texteditor.pri)
include(../../plugins/help/help.pri)
include(../../shared/qscripthighlighter/qscripthighlighter.pri) include(../../shared/qscripthighlighter/qscripthighlighter.pri)
include(../../shared/indenter/indenter.pri) include(../../shared/indenter/indenter.pri)
...@@ -51,11 +51,14 @@ ...@@ -51,11 +51,14 @@
#include <texteditor/textfilewizard.h> #include <texteditor/textfilewizard.h>
#include <texteditor/texteditoractionhandler.h> #include <texteditor/texteditoractionhandler.h>
#include <texteditor/completionsupport.h> #include <texteditor/completionsupport.h>
#include <help/helpplugin.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QtCore/QtPlugin> #include <QtCore/QtPlugin>
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QtCore/QSettings> #include <QtCore/QSettings>
#include <QtCore/QDir>
#include <QtCore/QCoreApplication>
#include <QtGui/QAction> #include <QtGui/QAction>
using namespace QmlEditor; using namespace QmlEditor;
...@@ -132,6 +135,27 @@ bool QmlEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err ...@@ -132,6 +135,27 @@ bool QmlEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
void QmlEditorPlugin::extensionsInitialized() void QmlEditorPlugin::extensionsInitialized()
{ {
//
// Explicitly register qml.qch if located in creator directory.
//
// This is only needed for the creator-qml package, were we
// want to ship the documentation without a qt development version.
//
ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance();
Help::HelpManager *helpManager = pluginManager->getObject<Help::HelpManager>();
Q_ASSERT(helpManager);
const QString qmlHelpFile =
QDir::cleanPath(QCoreApplication::applicationDirPath()
#if defined(Q_OS_MAC)
+ QLatin1String("/../Resources/doc/qml.qch"));
#else
+ QLatin1String("../../share/doc/qtcreator/qml.qch"));
#endif
helpManager->registerDocumentation(QStringList(qmlHelpFile));
} }
void QmlEditorPlugin::initializeEditor(QmlEditor::Internal::ScriptEditor *editor) void QmlEditorPlugin::initializeEditor(QmlEditor::Internal::ScriptEditor *editor)
......
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#include <texteditor/texteditoractionhandler.h> #include <texteditor/texteditoractionhandler.h>
#include <QtCore/QtPlugin> #include <QtCore/QtPlugin>
#include <QtCore/QDebug>
using namespace QmlProjectManager; using namespace QmlProjectManager;
using namespace QmlProjectManager::Internal; using namespace QmlProjectManager::Internal;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment