Commit 3ef43f56 authored by dt's avatar dt
Browse files

Move qmltaskmanager from qmlproject plugin to qmljseditor

parent 185bc0ee
......@@ -25,7 +25,8 @@ HEADERS += \
qmljsrefactoringchanges.h \
qmljscomponentfromobjectdef.h \
qmljsoutline.h \
qmloutlinemodel.h
qmloutlinemodel.h \
qmltaskmanager.h
SOURCES += \
qmljscodecompletion.cpp \
......@@ -43,7 +44,8 @@ SOURCES += \
qmljsrefactoringchanges.cpp \
qmljscomponentfromobjectdef.cpp \
qmljsoutline.cpp \
qmloutlinemodel.cpp
qmloutlinemodel.cpp \
qmltaskmanager.cpp
RESOURCES += qmljseditor.qrc
OTHER_FILES += QmlJSEditor.pluginspec QmlJSEditor.mimetypes.xml
......@@ -49,7 +49,7 @@ const char * const FOLLOW_SYMBOL_UNDER_CURSOR = "QmlJSEditor.FollowSymbolUnderCu
const char * const QML_MIMETYPE = "application/x-qml";
const char * const JS_MIMETYPE = "application/javascript";
const char *const TASK_CATEGORY_QML = "Task.Category.Qml";
} // namespace Constants
} // namespace QmlJSEditor
......
......@@ -40,6 +40,7 @@
#include "qmljspreviewrunner.h"
#include "qmljsquickfix.h"
#include "qmljs/qmljsicons.h"
#include "qmltaskmanager.h"
#include <qmldesigner/qmldesignerconstants.h>
......@@ -52,6 +53,7 @@
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/editormanager/editormanager.h>
#include <projectexplorer/taskhub.h>
#include <extensionsystem/pluginmanager.h>
#include <texteditor/fontsettings.h>
#include <texteditor/storagesettings.h>
......@@ -180,11 +182,22 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
addAutoReleasedObject(new QmlJSOutlineWidgetFactory);
m_qmlTaskManager = new QmlTaskManager;
addAutoReleasedObject(m_qmlTaskManager);
connect(m_modelManager, SIGNAL(documentChangedOnDisk(QmlJS::Document::Ptr)),
m_qmlTaskManager, SLOT(documentChangedOnDisk(QmlJS::Document::Ptr)));
connect(m_modelManager, SIGNAL(aboutToRemoveFiles(QStringList)),
m_qmlTaskManager, SLOT(documentsRemoved(QStringList)));
return true;
}
void QmlJSEditorPlugin::extensionsInitialized()
{
ProjectExplorer::TaskHub *taskHub =
ExtensionSystem::PluginManager::instance()->getObject<ProjectExplorer::TaskHub>();
taskHub->addCategory(Constants::TASK_CATEGORY_QML, tr("QML"));
}
ExtensionSystem::IPlugin::ShutdownFlag QmlJSEditorPlugin::aboutToShutdown()
......
......@@ -65,6 +65,7 @@ class QmlJSEditorFactory;
class QmlJSTextEditor;
class QmlJSPreviewRunner;
class QmlJSQuickFixCollector;
class QmlTaskManager;
class QmlJSEditorPlugin : public ExtensionSystem::IPlugin
{
......@@ -112,6 +113,7 @@ private:
QTimer *m_quickFixTimer;
QPointer<TextEditor::ITextEditable> m_currentTextEditable;
QmlTaskManager *m_qmlTaskManager;
};
} // namespace Internal
......
......@@ -28,14 +28,15 @@
**************************************************************************/
#include "qmltaskmanager.h"
#include "qmlprojectconstants.h"
#include "qmljseditorconstants.h"
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/taskhub.h>
#include <qmljs/qmljsmodelmanagerinterface.h>
#include <QDebug>
namespace QmlProjectManager {
namespace QmlJSEditor {
namespace Internal {
QmlTaskManager::QmlTaskManager(QObject *parent) :
......@@ -45,12 +46,6 @@ QmlTaskManager::QmlTaskManager(QObject *parent) :
m_taskHub = ExtensionSystem::PluginManager::instance()->getObject<ProjectExplorer::TaskHub>();
}
QmlTaskManager *QmlTaskManager::instance()
{
ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance();
return pluginManager->getObject<QmlTaskManager>();
}
void QmlTaskManager::documentChangedOnDisk(QmlJS::Document::Ptr doc)
{
const QString fileName = doc->fileName();
......
......@@ -42,7 +42,7 @@ namespace ProjectExplorer {
class TaskHub;
} // namespace ProjectExplorer
namespace QmlProjectManager {
namespace QmlJSEditor {
namespace Internal {
class QmlTaskManager : public QObject
......@@ -51,7 +51,7 @@ class QmlTaskManager : public QObject
public:
QmlTaskManager(QObject *parent = 0);
static QmlTaskManager *instance();
void extensionsInitialized();
public slots:
void documentChangedOnDisk(QmlJS::Document::Ptr doc);
......@@ -67,6 +67,6 @@ private:
};
} // Internal
} // QmlProjectManager
} // QmlJSEditor
#endif // QMLTASKMANAGER_H
......@@ -47,8 +47,6 @@ const char *const FILES_EDITOR_ID = "Qt4.QmlProjectEditor";
const char *const FILES_EDITOR_DISPLAY_NAME = QT_TRANSLATE_NOOP("OpenWith::Editors", ".qmlproject Editor");
const char *const FILES_MIMETYPE = QMLMIMETYPE;
const char *const TASK_CATEGORY_QML = "Task.Category.Qml";
// Wizard category
const char * const QML_WIZARD_CATEGORY = "F.Projects"; // (after Qt)
const char * const QML_WIZARD_TR_SCOPE = "QmlProjectManager";
......
......@@ -30,7 +30,6 @@
#include "qmlprojectmanager.h"
#include "qmlprojectconstants.h"
#include "qmlproject.h"
#include "qmltaskmanager.h"
#include <coreplugin/icore.h>
#include <coreplugin/ifile.h>
......
......@@ -19,7 +19,6 @@ HEADERS += qmlproject.h \
qmlprojectrunconfiguration.h \
qmlprojectrunconfigurationfactory.h \
qmlprojectapplicationwizard.h \
qmltaskmanager.h \
qmlprojectmanager_global.h \
qmlprojectmanagerconstants.h \
qmlprojecttarget.h
......@@ -33,7 +32,6 @@ SOURCES += qmlproject.cpp \
qmlprojectrunconfiguration.cpp \
qmlprojectrunconfigurationfactory.cpp \
qmlprojectapplicationwizard.cpp \
qmltaskmanager.cpp \
qmlprojecttarget.cpp
RESOURCES += qmlproject.qrc
......
......@@ -35,7 +35,6 @@
#include "qmlproject.h"
#include "qmlprojectrunconfigurationfactory.h"
#include "qmlprojectruncontrol.h"
#include "qmltaskmanager.h"
#include "fileformat/qmlprojectfileformat.h"
#include <extensionsystem/pluginmanager.h>
......@@ -47,15 +46,13 @@
#include <texteditor/texteditoractionhandler.h>
#include <projectexplorer/taskhub.h>
#include <qmljs/qmljsmodelmanagerinterface.h>
#include <QtCore/QtPlugin>
namespace QmlProjectManager {
namespace Internal {
QmlProjectPlugin::QmlProjectPlugin() :
m_qmlTaskManager(0)
QmlProjectPlugin::QmlProjectPlugin()
{ }
QmlProjectPlugin::~QmlProjectPlugin()
......@@ -76,9 +73,6 @@ bool QmlProjectPlugin::initialize(const QStringList &, QString *errorMessage)
Manager *manager = new Manager;
m_qmlTaskManager = new QmlTaskManager(this);
addAutoReleasedObject(m_qmlTaskManager);
addAutoReleasedObject(manager);
addAutoReleasedObject(new Internal::QmlProjectRunConfigurationFactory);
addAutoReleasedObject(new Internal::QmlRunControlFactory);
......@@ -94,16 +88,6 @@ bool QmlProjectPlugin::initialize(const QStringList &, QString *errorMessage)
void QmlProjectPlugin::extensionsInitialized()
{
ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance();
ProjectExplorer::TaskHub *taskHub = pluginManager->getObject<ProjectExplorer::TaskHub>();
taskHub->addCategory(Constants::TASK_CATEGORY_QML, tr("QML"));
QmlJS::ModelManagerInterface *modelManager = pluginManager->getObject<QmlJS::ModelManagerInterface>();
Q_ASSERT(modelManager);
connect(modelManager, SIGNAL(documentChangedOnDisk(QmlJS::Document::Ptr)),
m_qmlTaskManager, SLOT(documentChangedOnDisk(QmlJS::Document::Ptr)));
connect(modelManager, SIGNAL(aboutToRemoveFiles(QStringList)),
m_qmlTaskManager, SLOT(documentsRemoved(QStringList)));
}
} // namespace Internal
......
......@@ -38,7 +38,6 @@ namespace QmlProjectManager {
namespace Internal {
class ProjectFilesFactory;
class QmlTaskManager;
class QmlProjectPlugin: public ExtensionSystem::IPlugin
{
......@@ -50,9 +49,6 @@ public:
virtual bool initialize(const QStringList &arguments, QString *errorString);
virtual void extensionsInitialized();
private:
QmlTaskManager *m_qmlTaskManager;
};
} // namespace Internal
......
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