forked from qt-creator/qt-creator
CppTools: Change CppModelManager implementation pattern
Replace the CppModelManagerInterface/derived CppModelManager combo by a more common CppModelManager/CppModelManagerPrivate pimpl pattern. Change-Id: Ia4582845ed94d5ef60b8571bab9b2260c6290287 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
@@ -67,18 +67,18 @@ bool ClangCodeModelPlugin::initialize(const QStringList &arguments, QString *err
|
||||
|
||||
#ifdef CLANG_INDEXING
|
||||
m_indexer.reset(new ClangIndexer);
|
||||
CppTools::CppModelManagerInterface::instance()->setIndexingSupport(m_indexer->indexingSupport());
|
||||
CppTools::CppModelManager::instance()->setIndexingSupport(m_indexer->indexingSupport());
|
||||
#endif // CLANG_INDEXING
|
||||
|
||||
// wire up the pch manager
|
||||
QObject *session = ProjectExplorer::SessionManager::instance();
|
||||
connect(session, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)),
|
||||
pchManager, SLOT(onAboutToRemoveProject(ProjectExplorer::Project*)));
|
||||
connect(CppTools::CppModelManagerInterface::instance(), SIGNAL(projectPartsUpdated(ProjectExplorer::Project*)),
|
||||
connect(CppTools::CppModelManager::instance(), SIGNAL(projectPartsUpdated(ProjectExplorer::Project*)),
|
||||
pchManager, SLOT(onProjectPartsUpdated(ProjectExplorer::Project*)));
|
||||
|
||||
m_modelManagerSupport.reset(new ModelManagerSupport);
|
||||
CppTools::CppModelManagerInterface::instance()->addModelManagerSupport(
|
||||
CppTools::CppModelManager::instance()->addModelManagerSupport(
|
||||
m_modelManagerSupport.data());
|
||||
|
||||
return true;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
|
||||
#include <cpptools/cppdoxygen.h>
|
||||
#include <cpptools/cppmodelmanagerinterface.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cppworkingcopy.h>
|
||||
|
||||
#include <texteditor/basetexteditor.h>
|
||||
@@ -208,7 +208,7 @@ AssistInterface *ClangCompletionAssistProvider::createAssistInterface(
|
||||
{
|
||||
Q_UNUSED(isObjCEnabled);
|
||||
|
||||
CppModelManagerInterface *modelManager = CppModelManagerInterface::instance();
|
||||
CppModelManager *modelManager = CppModelManager::instance();
|
||||
QList<ProjectPart::Ptr> parts = modelManager->projectPart(filePath);
|
||||
if (parts.isEmpty())
|
||||
parts += modelManager->fallbackProjectPart();
|
||||
@@ -558,7 +558,7 @@ ClangCompletionAssistInterface::ClangCompletionAssistInterface(ClangCompleter::P
|
||||
{
|
||||
Q_ASSERT(!clangWrapper.isNull());
|
||||
|
||||
CppModelManagerInterface *mmi = CppModelManagerInterface::instance();
|
||||
CppModelManager *mmi = CppModelManager::instance();
|
||||
Q_ASSERT(mmi);
|
||||
m_unsavedFiles = Utils::createUnsavedFiles(mmi->workingCopy());
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <cplusplus/Icons.h>
|
||||
|
||||
#include <cpptools/cppcompletionassistprovider.h>
|
||||
#include <cpptools/cppmodelmanagerinterface.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
|
||||
#include <texteditor/codeassist/assistproposalitem.h>
|
||||
#include <texteditor/codeassist/completionassistprovider.h>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "pchinfo.h"
|
||||
#include "pchmanager.h"
|
||||
|
||||
#include <cpptools/cppmodelmanagerinterface.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cppprojects.h>
|
||||
#include <cpptools/cppworkingcopy.h>
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ void ClangEditorDocumentProcessor::run()
|
||||
{
|
||||
// Run clang parser
|
||||
const CppTools::WorkingCopy workingCopy
|
||||
= CppTools::CppModelManagerInterface::instance()->workingCopy();
|
||||
= CppTools::CppModelManager::instance()->workingCopy();
|
||||
|
||||
disconnect(&m_parserWatcher, &QFutureWatcher<void>::finished,
|
||||
this, &ClangEditorDocumentProcessor::onParserFinished);
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
#include <cpptools/cppmodelmanagerinterface.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <projectexplorer/session.h>
|
||||
|
||||
#include <QDir>
|
||||
@@ -94,7 +94,7 @@ CppTools::CppIndexingSupport *ClangIndexer::indexingSupport()
|
||||
QFuture<void> ClangIndexer::refreshSourceFiles(const QStringList &sourceFiles)
|
||||
{
|
||||
typedef CppTools::ProjectPart ProjectPart;
|
||||
CppTools::CppModelManagerInterface *mmi = CppTools::CppModelManagerInterface::instance();
|
||||
CppTools::CppModelManager *mmi = CppTools::CppModelManager::instance();
|
||||
LiveUnitsManager *lum = LiveUnitsManager::instance();
|
||||
|
||||
if (m_clangIndexer->isBusy())
|
||||
@@ -149,7 +149,7 @@ void ClangIndexer::indexNow(Unit::Ptr unit)
|
||||
typedef CppTools::ProjectPart ProjectPart;
|
||||
|
||||
QString file = unit->fileName();
|
||||
CppTools::CppModelManagerInterface *mmi = CppTools::CppModelManagerInterface::instance();
|
||||
CppTools::CppModelManager *mmi = CppTools::CppModelManager::instance();
|
||||
const QList<ProjectPart::Ptr> &parts = mmi->projectPart(file);
|
||||
ProjectPart::Ptr part;
|
||||
if (!parts.isEmpty())
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
#include <cpptools/cppmodelmanagerinterface.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
|
||||
namespace ClangCodeModel {
|
||||
namespace Utils {
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "symbol.h"
|
||||
#include "unit.h"
|
||||
|
||||
#include <cpptools/cppmodelmanagerinterface.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QString>
|
||||
|
||||
@@ -142,7 +142,7 @@ void PchManager::onProjectPartsUpdated(ProjectExplorer::Project *project)
|
||||
ClangProjectSettings *cps = settingsForProject(project);
|
||||
Q_ASSERT(cps);
|
||||
|
||||
CppTools::CppModelManagerInterface *mmi = CppTools::CppModelManagerInterface::instance();
|
||||
CppTools::CppModelManager *mmi = CppTools::CppModelManager::instance();
|
||||
const QList<ProjectPart::Ptr> projectParts = mmi->projectInfo(
|
||||
cps->project()).projectParts();
|
||||
updatePchInfo(cps, projectParts);
|
||||
@@ -435,7 +435,7 @@ void PchManager::updateActivePchFiles()
|
||||
QMutexLocker locker(&m_mutex);
|
||||
|
||||
QSet<ProjectPart::Ptr> activeParts;
|
||||
CppTools::CppModelManagerInterface *mmi = CppTools::CppModelManagerInterface::instance();
|
||||
CppTools::CppModelManager *mmi = CppTools::CppModelManager::instance();
|
||||
foreach (const CppTools::ProjectInfo &pi, mmi->projectInfos())
|
||||
activeParts.unite(QSet<ProjectPart::Ptr>::fromList(pi.projectParts()));
|
||||
QList<ProjectPart::Ptr> partsWithPCHFiles = m_activePchFiles.keys();
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "clangprojectsettings.h"
|
||||
#include "pchinfo.h"
|
||||
|
||||
#include <cpptools/cppmodelmanagerinterface.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user