From d24cb60d487e2241c8364b83658f31178305176a Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Thu, 23 Jan 2014 14:28:31 +0100 Subject: qml: moving most of ModelManager logic to ModelManageInterface Currently ModelManager contains lot logic, but as it sits in QmlJSTools it is not possible to use it in standalone tests. Moving most of the logic to ModelManagerInterface (and cleanup) to allow better testing, and refactoring. This introduces a dependency of the qmljs lib on the cplusplus lib Also a (small) part of the CppTool::ModelManagerInterface has been moved to CPlusPlus::CppModelManagerBase to remove the dependency on CppTools to gather the Qml types exposed from C++. Change-Id: Icad7fe96dfd0f1a2b1058d82bd98c77c40aa5e9d Reviewed-by: Fawzi Mohamed --- src/plugins/cpptools/cppmodelmanagerinterface.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/plugins/cpptools/cppmodelmanagerinterface.cpp') diff --git a/src/plugins/cpptools/cppmodelmanagerinterface.cpp b/src/plugins/cpptools/cppmodelmanagerinterface.cpp index e755783bef..0f65f16225 100644 --- a/src/plugins/cpptools/cppmodelmanagerinterface.cpp +++ b/src/plugins/cpptools/cppmodelmanagerinterface.cpp @@ -164,8 +164,6 @@ void ProjectPart::evaluateToolchain(const ToolChain *tc, toolchainDefines = tc->predefinedMacros(cxxflags); } -static CppModelManagerInterface *g_instance = 0; - const QString CppModelManagerInterface::configurationFileName() { return CPlusPlus::Preprocessor::configurationFileName; } @@ -175,21 +173,15 @@ const QString CppModelManagerInterface::editorConfigurationFileName() } CppModelManagerInterface::CppModelManagerInterface(QObject *parent) - : QObject(parent) -{ - Q_ASSERT(!g_instance); - g_instance = this; -} + : CPlusPlus::CppModelManagerBase(parent) +{ } CppModelManagerInterface::~CppModelManagerInterface() -{ - Q_ASSERT(g_instance == this); - g_instance = 0; -} +{ } CppModelManagerInterface *CppModelManagerInterface::instance() { - return g_instance; + return qobject_cast(CPlusPlus::CppModelManagerBase::instance()); } void CppModelManagerInterface::ProjectInfo::clearProjectParts() -- cgit v1.2.1