Commit 299f1395 authored by dt's avatar dt

Revert "Remove the QmlJSEditor dependency from Qt4ProjectManager."

This reverts commit f8c50013.
parent 699ff228
...@@ -90,17 +90,6 @@ public: ...@@ -90,17 +90,6 @@ public:
return result; return result;
} }
QObject *getObjectByName(const QString &name) const
{
QReadLocker lock(&m_lock);
QList<QObject *> all = allObjects();
foreach (QObject *obj, all) {
if (obj->objectName() == name)
return obj;
}
return 0;
}
// Plugin operations // Plugin operations
QList<PluginSpec *> loadQueue(); QList<PluginSpec *> loadQueue();
void loadPlugins(); void loadPlugins();
......
...@@ -38,7 +38,6 @@ ModelManagerInterface::ModelManagerInterface(QObject *parent) ...@@ -38,7 +38,6 @@ ModelManagerInterface::ModelManagerInterface(QObject *parent)
{ {
Q_ASSERT(! g_instance); Q_ASSERT(! g_instance);
g_instance = this; g_instance = this;
setObjectName(MODELMANAGERINTERFACE_OBJECTNAME);
} }
ModelManagerInterface::~ModelManagerInterface() ModelManagerInterface::~ModelManagerInterface()
......
...@@ -46,8 +46,6 @@ QT_QML_BEGIN_NAMESPACE ...@@ -46,8 +46,6 @@ QT_QML_BEGIN_NAMESPACE
namespace QmlJS { namespace QmlJS {
const char *const MODELMANAGERINTERFACE_OBJECTNAME = "QmlJS::ModelManagerInterface";
class Snapshot; class Snapshot;
class QMLJS_EXPORT ModelManagerInterface: public QObject class QMLJS_EXPORT ModelManagerInterface: public QObject
...@@ -119,8 +117,8 @@ public: ...@@ -119,8 +117,8 @@ public:
virtual void removeFiles(const QStringList &files) = 0; virtual void removeFiles(const QStringList &files) = 0;
virtual QList<ProjectInfo> projectInfos() const = 0; virtual QList<ProjectInfo> projectInfos() const = 0;
Q_INVOKABLE virtual QmlJS::ModelManagerInterface::ProjectInfo projectInfo(ProjectExplorer::Project *project) const = 0; virtual ProjectInfo projectInfo(ProjectExplorer::Project *project) const = 0;
Q_INVOKABLE virtual void updateProjectInfo(const QmlJS::ModelManagerInterface::ProjectInfo &pinfo) = 0; virtual void updateProjectInfo(const ProjectInfo &pinfo) = 0;
virtual QStringList importPaths() const = 0; virtual QStringList importPaths() const = 0;
......
...@@ -126,6 +126,7 @@ plugin_qt4projectmanager.depends = plugin_texteditor ...@@ -126,6 +126,7 @@ plugin_qt4projectmanager.depends = plugin_texteditor
plugin_qt4projectmanager.depends += plugin_projectexplorer plugin_qt4projectmanager.depends += plugin_projectexplorer
plugin_qt4projectmanager.depends += plugin_cpptools plugin_qt4projectmanager.depends += plugin_cpptools
plugin_qt4projectmanager.depends += plugin_cppeditor plugin_qt4projectmanager.depends += plugin_cppeditor
plugin_qt4projectmanager.depends += plugin_qmljseditor
plugin_qt4projectmanager.depends += plugin_designer plugin_qt4projectmanager.depends += plugin_designer
plugin_qt4projectmanager.depends += plugin_debugger plugin_qt4projectmanager.depends += plugin_debugger
plugin_qt4projectmanager.depends += plugin_qmljseditor plugin_qt4projectmanager.depends += plugin_qmljseditor
......
...@@ -62,7 +62,7 @@ public: ...@@ -62,7 +62,7 @@ public:
virtual void removeFiles(const QStringList &files); virtual void removeFiles(const QStringList &files);
virtual QList<ProjectInfo> projectInfos() const; virtual QList<ProjectInfo> projectInfos() const;
virtual QmlJS::ModelManagerInterface::ProjectInfo projectInfo(ProjectExplorer::Project *project) const; virtual ProjectInfo projectInfo(ProjectExplorer::Project *project) const;
virtual void updateProjectInfo(const ProjectInfo &pinfo); virtual void updateProjectInfo(const ProjectInfo &pinfo);
void emitDocumentUpdated(QmlJS::Document::Ptr doc); void emitDocumentUpdated(QmlJS::Document::Ptr doc);
......
...@@ -18,6 +18,7 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General ...@@ -18,6 +18,7 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General
<dependency name="ProjectExplorer" version="2.0.90"/> <dependency name="ProjectExplorer" version="2.0.90"/>
<dependency name="CppTools" version="2.0.90"/> <dependency name="CppTools" version="2.0.90"/>
<dependency name="CppEditor" version="2.0.90"/> <dependency name="CppEditor" version="2.0.90"/>
<dependency name="QmlJSEditor" version="2.0.90"/>
<dependency name="Designer" version="2.0.90"/> <dependency name="Designer" version="2.0.90"/>
<dependency name="Debugger" version="2.0.90"/> <dependency name="Debugger" version="2.0.90"/>
</dependencyList> </dependencyList>
......
...@@ -567,17 +567,11 @@ void Qt4Project::updateCppCodeModel() ...@@ -567,17 +567,11 @@ void Qt4Project::updateCppCodeModel()
void Qt4Project::updateQmlJSCodeModel() void Qt4Project::updateQmlJSCodeModel()
{ {
QObject *modelManager = QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
ExtensionSystem::PluginManager::instance()->getObjectByName(QmlJS::MODELMANAGERINTERFACE_OBJECTNAME);
if (!modelManager) if (!modelManager)
return; return;
QmlJS::ModelManagerInterface::ProjectInfo projectInfo; QmlJS::ModelManagerInterface::ProjectInfo projectInfo = modelManager->projectInfo(this);
bool success = QMetaObject::invokeMethod(
modelManager, "projectInfo", Qt::DirectConnection,
Q_RETURN_ARG(QmlJS::ModelManagerInterface::ProjectInfo, projectInfo),
Q_ARG(ProjectExplorer::Project *, this));
QTC_ASSERT(success, return);
// Not essential since the QmlJS engine parses required files on demand. // Not essential since the QmlJS engine parses required files on demand.
//projectInfo.sourceFiles = ... //projectInfo.sourceFiles = ...
...@@ -590,10 +584,7 @@ void Qt4Project::updateQmlJSCodeModel() ...@@ -590,10 +584,7 @@ void Qt4Project::updateQmlJSCodeModel()
} }
projectInfo.importPaths.removeDuplicates(); projectInfo.importPaths.removeDuplicates();
success = QMetaObject::invokeMethod( modelManager->updateProjectInfo(projectInfo);
modelManager, "updateProjectInfo", Qt::DirectConnection,
Q_ARG(QmlJS::ModelManagerInterface::ProjectInfo, projectInfo));
QTC_ASSERT(success, return);
} }
void Qt4Project::qtVersionsChanged() void Qt4Project::qtVersionsChanged()
......
include(../../plugins/projectexplorer/projectexplorer.pri) include(../../plugins/projectexplorer/projectexplorer.pri)
include(../../plugins/cpptools/cpptools.pri) include(../../plugins/cpptools/cpptools.pri)
include(../../plugins/cppeditor/cppeditor.pri) include(../../plugins/cppeditor/cppeditor.pri)
include(../../plugins/qmljseditor/qmljseditor.pri)
include(../../plugins/designer/designer.pri) include(../../plugins/designer/designer.pri)
include(../../plugins/debugger/debugger.pri) include(../../plugins/debugger/debugger.pri)
include(../../libs/symbianutils/symbianutils.pri) include(../../libs/symbianutils/symbianutils.pri)
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