summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-09-15 00:12:27 +0200
committerNikolai Kosjar <nikolai.kosjar@digia.com>2014-09-19 13:17:55 +0200
commitb26a17f30dea7e4ac78a31983176681a7a5d07d3 (patch)
tree95ad0b459d9055f4fd6e6623ad1ab0b075730d57
parente5e8693148304d3262096e6622386bdff8e4e1ad (diff)
downloadqt-creator-b26a17f30dea7e4ac78a31983176681a7a5d07d3.tar.gz
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>
-rw-r--r--src/plugins/analyzerbase/analyzerutils.cpp6
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsproject.cpp6
-rw-r--r--src/plugins/clangcodemodel/clangcodemodelplugin.cpp6
-rw-r--r--src/plugins/clangcodemodel/clangcompletion.cpp6
-rw-r--r--src/plugins/clangcodemodel/clangcompletion.h2
-rw-r--r--src/plugins/clangcodemodel/clangeditordocumentparser.cpp2
-rw-r--r--src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp2
-rw-r--r--src/plugins/clangcodemodel/clangindexer.cpp6
-rw-r--r--src/plugins/clangcodemodel/clangutils.h2
-rw-r--r--src/plugins/clangcodemodel/indexer.h2
-rw-r--r--src/plugins/clangcodemodel/pchmanager.cpp4
-rw-r--r--src/plugins/clangcodemodel/pchmanager.h2
-rw-r--r--src/plugins/classview/classviewmanager.cpp6
-rw-r--r--src/plugins/classview/classviewparser.cpp4
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeproject.cpp6
-rw-r--r--src/plugins/cppeditor/cppcodemodelinspectordialog.cpp2
-rw-r--r--src/plugins/cppeditor/cppcodemodelinspectordialog.h2
-rw-r--r--src/plugins/cppeditor/cppdoxygen_test.cpp2
-rw-r--r--src/plugins/cppeditor/cppeditor.cpp12
-rw-r--r--src/plugins/cppeditor/cppeditordocument.cpp6
-rw-r--r--src/plugins/cppeditor/cppeditordocument.h2
-rw-r--r--src/plugins/cppeditor/cppeditoroutline.cpp4
-rw-r--r--src/plugins/cppeditor/cppeditorplugin.cpp2
-rw-r--r--src/plugins/cppeditor/cppelementevaluator.cpp2
-rw-r--r--src/plugins/cppeditor/cppelementevaluator.h4
-rw-r--r--src/plugins/cppeditor/cppfollowsymbolundercursor.cpp8
-rw-r--r--src/plugins/cppeditor/cppincludehierarchy_test.cpp2
-rw-r--r--src/plugins/cppeditor/cppincludehierarchymodel.cpp4
-rw-r--r--src/plugins/cppeditor/cpppreprocessordialog.h2
-rw-r--r--src/plugins/cppeditor/cppquickfixassistant.cpp2
-rw-r--r--src/plugins/cppeditor/cppquickfixes.cpp2
-rw-r--r--src/plugins/cppeditor/cppuseselectionsupdater.cpp4
-rw-r--r--src/plugins/cppeditor/fileandtokenactions_test.cpp2
-rw-r--r--src/plugins/cpptools/abstracteditorsupport.cpp6
-rw-r--r--src/plugins/cpptools/abstracteditorsupport.h8
-rw-r--r--src/plugins/cpptools/baseeditordocumentparser.cpp4
-rw-r--r--src/plugins/cpptools/baseeditordocumentparser.h2
-rw-r--r--src/plugins/cpptools/baseeditordocumentprocessor.cpp4
-rw-r--r--src/plugins/cpptools/builtineditordocumentparser.cpp5
-rw-r--r--src/plugins/cpptools/builtineditordocumentprocessor.cpp9
-rw-r--r--src/plugins/cpptools/builtinindexingsupport.cpp6
-rw-r--r--src/plugins/cpptools/builtinindexingsupport.h4
-rw-r--r--src/plugins/cpptools/cppcodemodelinspectordumper.cpp2
-rw-r--r--src/plugins/cpptools/cppcodemodelinspectordumper.h2
-rw-r--r--src/plugins/cpptools/cppcompletionassist.cpp6
-rw-r--r--src/plugins/cpptools/cppcompletionassist.h2
-rw-r--r--src/plugins/cpptools/cppcurrentdocumentfilter.h3
-rw-r--r--src/plugins/cpptools/cppfindreferences.cpp6
-rw-r--r--src/plugins/cpptools/cppfindreferences.h6
-rw-r--r--src/plugins/cpptools/cppindexingsupport.h4
-rw-r--r--src/plugins/cpptools/cpplocatorfilter.h2
-rw-r--r--src/plugins/cpptools/cppmodelmanager.cpp287
-rw-r--r--src/plugins/cpptools/cppmodelmanager.h164
-rw-r--r--src/plugins/cpptools/cppmodelmanager_test.cpp6
-rw-r--r--src/plugins/cpptools/cppmodelmanagerinterface.cpp114
-rw-r--r--src/plugins/cpptools/cppmodelmanagerinterface.h153
-rw-r--r--src/plugins/cpptools/cpprefactoringchanges.cpp4
-rw-r--r--src/plugins/cpptools/cpprefactoringchanges.h2
-rw-r--r--src/plugins/cpptools/cppsourceprocessor.h2
-rw-r--r--src/plugins/cpptools/cpptools.pro2
-rw-r--r--src/plugins/cpptools/cpptools.qbs1
-rw-r--r--src/plugins/cpptools/cpptoolsplugin.h1
-rw-r--r--src/plugins/cpptools/cpptoolstestcase.cpp12
-rw-r--r--src/plugins/cpptools/cpptoolstestcase.h4
-rw-r--r--src/plugins/cpptools/symbolsfindfilter.h3
-rw-r--r--src/plugins/cpptools/typehierarchybuilder.h2
-rw-r--r--src/plugins/cpptools/typehierarchybuilder_test.cpp2
-rw-r--r--src/plugins/debugger/cdb/cdbengine.cpp4
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp4
-rw-r--r--src/plugins/debugger/sourceutils.cpp6
-rw-r--r--src/plugins/designer/codemodelhelpers.cpp4
-rw-r--r--src/plugins/designer/qtcreatorintegration.cpp12
-rw-r--r--src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp4
-rw-r--r--src/plugins/genericprojectmanager/cppmodelmanagerhelper.h4
-rw-r--r--src/plugins/genericprojectmanager/genericproject.cpp6
-rw-r--r--src/plugins/genericprojectmanager/genericprojectplugin_test.cpp2
-rw-r--r--src/plugins/qbsprojectmanager/qbsproject.cpp6
-rw-r--r--src/plugins/qmakeprojectmanager/qmakenodes.cpp2
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeproject.cpp12
-rw-r--r--src/plugins/qmljstools/qmljsmodelmanager.cpp6
-rw-r--r--src/plugins/qmljstools/qmljsmodelmanager.h7
-rw-r--r--src/plugins/qtsupport/uicodemodelsupport.cpp8
-rw-r--r--src/plugins/qtsupport/uicodemodelsupport.h4
-rw-r--r--src/plugins/texteditor/codeassist/keywordscompletionassist.cpp12
-rw-r--r--src/plugins/texteditor/codeassist/keywordscompletionassist.h4
-rw-r--r--src/plugins/todo/cpptodoitemsscanner.cpp6
-rw-r--r--src/plugins/todo/cpptodoitemsscanner.h2
-rw-r--r--src/plugins/todo/todoitemsprovider.cpp2
-rw-r--r--src/plugins/vcsbase/vcsbasesubmiteditor.cpp4
89 files changed, 428 insertions, 659 deletions
diff --git a/src/plugins/analyzerbase/analyzerutils.cpp b/src/plugins/analyzerbase/analyzerutils.cpp
index c26d4fa8ec..b9a22bb415 100644
--- a/src/plugins/analyzerbase/analyzerutils.cpp
+++ b/src/plugins/analyzerbase/analyzerutils.cpp
@@ -31,14 +31,14 @@
#include "analyzerconstants.h"
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <texteditor/basetexteditor.h>
#include <utils/qtcassert.h>
#include <cplusplus/ExpressionUnderCursor.h>
#include <cplusplus/TypeOfExpression.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <QTextCursor>
@@ -72,7 +72,7 @@ CPlusPlus::Symbol *AnalyzerUtils::findSymbolUnderCursor()
const int pos = tc.position();
editor->convertPosition(pos, &line, &column);
- const CPlusPlus::Snapshot &snapshot = CppTools::CppModelManagerInterface::instance()->snapshot();
+ const CPlusPlus::Snapshot &snapshot = CppTools::CppModelManager::instance()->snapshot();
CPlusPlus::Document::Ptr doc = snapshot.document(editor->document()->filePath());
QTC_ASSERT(doc, return 0);
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
index 91ddbdde66..059327c2a5 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
+++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
@@ -49,7 +49,7 @@
#include <projectexplorer/target.h>
#include <projectexplorer/headerpath.h>
#include <extensionsystem/pluginmanager.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/icontext.h>
#include <utils/qtcassert.h>
@@ -400,8 +400,8 @@ QList<Node *> AutotoolsProject::nodes(FolderNode *parent) const
void AutotoolsProject::updateCppCodeModel()
{
- CppTools::CppModelManagerInterface *modelManager =
- CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *modelManager =
+ CppTools::CppModelManager::instance();
if (!modelManager)
return;
diff --git a/src/plugins/clangcodemodel/clangcodemodelplugin.cpp b/src/plugins/clangcodemodel/clangcodemodelplugin.cpp
index 40ed8725c9..cf2f962128 100644
--- a/src/plugins/clangcodemodel/clangcodemodelplugin.cpp
+++ b/src/plugins/clangcodemodel/clangcodemodelplugin.cpp
@@ -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;
diff --git a/src/plugins/clangcodemodel/clangcompletion.cpp b/src/plugins/clangcodemodel/clangcompletion.cpp
index 1958c16de7..ec7855b0ac 100644
--- a/src/plugins/clangcodemodel/clangcompletion.cpp
+++ b/src/plugins/clangcodemodel/clangcompletion.cpp
@@ -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());
}
diff --git a/src/plugins/clangcodemodel/clangcompletion.h b/src/plugins/clangcodemodel/clangcompletion.h
index 0f9ada9efd..6ecb262f60 100644
--- a/src/plugins/clangcodemodel/clangcompletion.h
+++ b/src/plugins/clangcodemodel/clangcompletion.h
@@ -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>
diff --git a/src/plugins/clangcodemodel/clangeditordocumentparser.cpp b/src/plugins/clangcodemodel/clangeditordocumentparser.cpp
index f5e40bf6e2..4c0a0c48d1 100644
--- a/src/plugins/clangcodemodel/clangeditordocumentparser.cpp
+++ b/src/plugins/clangcodemodel/clangeditordocumentparser.cpp
@@ -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>
diff --git a/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp b/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp
index 8ef76bf630..f485bffd5a 100644
--- a/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp
+++ b/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp
@@ -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);
diff --git a/src/plugins/clangcodemodel/clangindexer.cpp b/src/plugins/clangcodemodel/clangindexer.cpp
index 160636b2df..f0e5f02286 100644
--- a/src/plugins/clangcodemodel/clangindexer.cpp
+++ b/src/plugins/clangcodemodel/clangindexer.cpp
@@ -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())
diff --git a/src/plugins/clangcodemodel/clangutils.h b/src/plugins/clangcodemodel/clangutils.h
index 132b03da90..85f5f9e7ba 100644
--- a/src/plugins/clangcodemodel/clangutils.h
+++ b/src/plugins/clangcodemodel/clangutils.h
@@ -32,7 +32,7 @@
#include "utils.h"
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
namespace ClangCodeModel {
namespace Utils {
diff --git a/src/plugins/clangcodemodel/indexer.h b/src/plugins/clangcodemodel/indexer.h
index 9b6e8c1297..d67523948b 100644
--- a/src/plugins/clangcodemodel/indexer.h
+++ b/src/plugins/clangcodemodel/indexer.h
@@ -34,7 +34,7 @@
#include "symbol.h"
#include "unit.h"
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <QtCore/QObject>
#include <QtCore/QString>
diff --git a/src/plugins/clangcodemodel/pchmanager.cpp b/src/plugins/clangcodemodel/pchmanager.cpp
index 2f2e95b934..444c055633 100644
--- a/src/plugins/clangcodemodel/pchmanager.cpp
+++ b/src/plugins/clangcodemodel/pchmanager.cpp
@@ -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();
diff --git a/src/plugins/clangcodemodel/pchmanager.h b/src/plugins/clangcodemodel/pchmanager.h
index dafca695db..846ee8f75b 100644
--- a/src/plugins/clangcodemodel/pchmanager.h
+++ b/src/plugins/clangcodemodel/pchmanager.h
@@ -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>
diff --git a/src/plugins/classview/classviewmanager.cpp b/src/plugins/classview/classviewmanager.cpp
index 09d7796648..564d614063 100644
--- a/src/plugins/classview/classviewmanager.cpp
+++ b/src/plugins/classview/classviewmanager.cpp
@@ -36,7 +36,7 @@
#include <utils/qtcassert.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cpptools/cpptoolsconstants.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -269,8 +269,8 @@ void Manager::initialize()
&d->parser, SLOT(setFlatMode(bool)), Qt::QueuedConnection);
// connect to the cpp model manager for signals about document updates
- CppTools::CppModelManagerInterface *codeModelManager
- = CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *codeModelManager
+ = CppTools::CppModelManager::instance();
// when code manager signals that document is updated - handle it by ourselves
connect(codeModelManager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)),
diff --git a/src/plugins/classview/classviewparser.cpp b/src/plugins/classview/classviewparser.cpp
index 828e42d6c4..66a295f0c8 100644
--- a/src/plugins/classview/classviewparser.cpp
+++ b/src/plugins/classview/classviewparser.cpp
@@ -38,7 +38,7 @@
#include <cplusplus/Name.h>
// other
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cplusplus/Overview.h>
#include <cplusplus/Icons.h>
#include <projectexplorer/projectexplorer.h>
@@ -666,7 +666,7 @@ void Parser::resetData(const CPlusPlus::Snapshot &snapshot)
void Parser::resetDataToCurrentState()
{
// get latest data
- CppTools::CppModelManagerInterface *codeModel = CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *codeModel = CppTools::CppModelManager::instance();
if (codeModel)
resetData(codeModel->snapshot());
}
diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
index 4816f21236..416ae5fb47 100644
--- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
@@ -53,7 +53,7 @@
#include <qtsupport/baseqtversion.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/uicodemodelsupport.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/algorithm.h>
#include <utils/qtcassert.h>
@@ -326,8 +326,8 @@ bool CMakeProject::parseCMakeLists()
return true;
}
- CppTools::CppModelManagerInterface *modelmanager =
- CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *modelmanager =
+ CppTools::CppModelManager::instance();
if (modelmanager) {
CppTools::ProjectInfo pinfo = modelmanager->projectInfo(this);
pinfo.clearProjectParts();
diff --git a/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp b/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
index b6c19c6dbc..9ea746247d 100644
--- a/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
+++ b/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
@@ -1339,7 +1339,7 @@ void CppCodeModelInspectorDialog::onWorkingCopyDocumentSelected(const QModelInde
void CppCodeModelInspectorDialog::refresh()
{
- CppTools::CppModelManagerInterface *cmmi = CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *cmmi = CppTools::CppModelManager::instance();
const int oldSnapshotIndex = m_ui->snapshotSelector->currentIndex();
const bool selectEditorRelevant
diff --git a/src/plugins/cppeditor/cppcodemodelinspectordialog.h b/src/plugins/cppeditor/cppcodemodelinspectordialog.h
index 569453c001..0acf938979 100644
--- a/src/plugins/cppeditor/cppcodemodelinspectordialog.h
+++ b/src/plugins/cppeditor/cppcodemodelinspectordialog.h
@@ -30,7 +30,7 @@
#ifndef CPPCODEMODELINSPECTORDIALOG_H
#define CPPCODEMODELINSPECTORDIALOG_H
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cplusplus/CppDocument.h>
diff --git a/src/plugins/cppeditor/cppdoxygen_test.cpp b/src/plugins/cppeditor/cppdoxygen_test.cpp
index e967ba053f..6d17d7fa4b 100644
--- a/src/plugins/cppeditor/cppdoxygen_test.cpp
+++ b/src/plugins/cppeditor/cppdoxygen_test.cpp
@@ -31,7 +31,7 @@
#include "cppeditortestcase.h"
#include <coreplugin/editormanager/editormanager.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cplusplus/CppDocument.h>
#include <utils/fileutils.h>
diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp
index d2f21507d0..36c24fd514 100644
--- a/src/plugins/cppeditor/cppeditor.cpp
+++ b/src/plugins/cppeditor/cppeditor.cpp
@@ -50,7 +50,7 @@
#include <cpptools/cppchecksymbols.h>
#include <cpptools/cppcodeformatter.h>
#include <cpptools/cppcompletionassistprovider.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cpptools/cppsemanticinfo.h>
#include <cpptools/cpptoolsconstants.h>
#include <cpptools/cpptoolsplugin.h>
@@ -102,7 +102,7 @@ public:
CppEditorWidgetPrivate(CppEditorWidget *q);
public:
- QPointer<CppTools::CppModelManagerInterface> m_modelManager;
+ QPointer<CppTools::CppModelManager> m_modelManager;
CppEditorDocument *m_cppEditorDocument;
CppEditorOutline *m_cppEditorOutline;
@@ -126,7 +126,7 @@ public:
};
CppEditorWidgetPrivate::CppEditorWidgetPrivate(CppEditorWidget *q)
- : m_modelManager(CppModelManagerInterface::instance())
+ : m_modelManager(CppModelManager::instance())
, m_cppEditorDocument(qobject_cast<CppEditorDocument *>(q->textDocument()))
, m_cppEditorOutline(new CppEditorOutline(q))
, m_cppDocumentationCommentHelper(q)
@@ -302,7 +302,7 @@ void CppEditorWidget::findUsages()
return;
SemanticInfo info = d->m_lastSemanticInfo;
- info.snapshot = CppModelManagerInterface::instance()->snapshot();
+ info.snapshot = CppModelManager::instance()->snapshot();
info.snapshot.insert(info.doc);
if (const Macro *macro = CppTools::findCanonicalMacro(textCursor(), info.doc)) {
@@ -321,7 +321,7 @@ void CppEditorWidget::renameUsages(const QString &replacement)
return;
SemanticInfo info = d->m_lastSemanticInfo;
- info.snapshot = CppModelManagerInterface::instance()->snapshot();
+ info.snapshot = CppModelManager::instance()->snapshot();
info.snapshot.insert(info.doc);
if (const Macro *macro = CppTools::findCanonicalMacro(textCursor(), info.doc)) {
@@ -694,7 +694,7 @@ void CppEditorWidget::updateFunctionDeclDefLinkNow()
if (!isSemanticInfoValidExceptLocalUses())
return;
- Snapshot snapshot = CppModelManagerInterface::instance()->snapshot();
+ Snapshot snapshot = CppModelManager::instance()->snapshot();
snapshot.insert(semanticDoc);
d->m_declDefLinkFinder->startFindLinkAt(textCursor(), semanticDoc, snapshot);
diff --git a/src/plugins/cppeditor/cppeditordocument.cpp b/src/plugins/cppeditor/cppeditordocument.cpp
index b2472fecb3..559b38768f 100644
--- a/src/plugins/cppeditor/cppeditordocument.cpp
+++ b/src/plugins/cppeditor/cppeditordocument.cpp
@@ -36,7 +36,7 @@
#include <cpptools/builtineditordocumentprocessor.h>
#include <cpptools/cppcodeformatter.h>
#include <cpptools/cppcodemodelsettings.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cpptools/cppqtstyleindenter.h>
#include <cpptools/cpptoolsconstants.h>
#include <cpptools/cpptoolsplugin.h>
@@ -50,9 +50,9 @@
namespace {
-CppTools::CppModelManagerInterface *mm()
+CppTools::CppModelManager *mm()
{
- return CppTools::CppModelManagerInterface::instance();
+ return CppTools::CppModelManager::instance();
}
} // anonymous namespace
diff --git a/src/plugins/cppeditor/cppeditordocument.h b/src/plugins/cppeditor/cppeditordocument.h
index 7f1534844e..13bfd66fc3 100644
--- a/src/plugins/cppeditor/cppeditordocument.h
+++ b/src/plugins/cppeditor/cppeditordocument.h
@@ -32,7 +32,7 @@
#include <cpptools/baseeditordocumentprocessor.h>
#include <cpptools/cppcompletionassistprovider.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cpptools/cppsemanticinfo.h>
#include <cpptools/editordocumenthandle.h>
diff --git a/src/plugins/cppeditor/cppeditoroutline.cpp b/src/plugins/cppeditor/cppeditoroutline.cpp
index 969108a50e..52ff50b829 100644
--- a/src/plugins/cppeditor/cppeditoroutline.cpp
+++ b/src/plugins/cppeditor/cppeditoroutline.cpp
@@ -32,7 +32,7 @@
#include "cppeditor.h"
#include "cppeditorplugin.h"
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cplusplus/OverviewModel.h>
#include <utils/treeviewcombobox.h>
@@ -189,7 +189,7 @@ QWidget *CppEditorOutline::widget() const
void CppEditorOutline::updateNow()
{
- CppTools::CppModelManagerInterface *cmmi = CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *cmmi = CppTools::CppModelManager::instance();
if (!cmmi)
return;
diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp
index cb00366018..6b4e5caf31 100644
--- a/src/plugins/cppeditor/cppeditorplugin.cpp
+++ b/src/plugins/cppeditor/cppeditorplugin.cpp
@@ -288,7 +288,7 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
cppToolsMenu->addSeparator(globalContext);
m_reparseExternallyChangedFiles = new QAction(tr("Reparse Externally Changed Files"), this);
cmd = ActionManager::registerAction(m_reparseExternallyChangedFiles, Constants::UPDATE_CODEMODEL, globalContext);
- CppTools::CppModelManagerInterface *cppModelManager = CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *cppModelManager = CppTools::CppModelManager::instance();
connect(m_reparseExternallyChangedFiles, SIGNAL(triggered()), cppModelManager, SLOT(updateModifiedSourceFiles()));
cppToolsMenu->addAction(cmd);
diff --git a/src/plugins/cppeditor/cppelementevaluator.cpp b/src/plugins/cppeditor/cppelementevaluator.cpp
index f833d2e387..859fb5aa5b 100644
--- a/src/plugins/cppeditor/cppelementevaluator.cpp
+++ b/src/plugins/cppeditor/cppelementevaluator.cpp
@@ -63,7 +63,7 @@ static QStringList stripName(const QString &name)
CppElementEvaluator::CppElementEvaluator(TextEditor::BaseTextEditorWidget *editor) :
m_editor(editor),
- m_modelManager(CppTools::CppModelManagerInterface::instance()),
+ m_modelManager(CppTools::CppModelManager::instance()),
m_tc(editor->textCursor()),
m_lookupBaseClasses(false),
m_lookupDerivedClasses(false)
diff --git a/src/plugins/cppeditor/cppelementevaluator.h b/src/plugins/cppeditor/cppelementevaluator.h
index 1a8050a854..1eede15a81 100644
--- a/src/plugins/cppeditor/cppelementevaluator.h
+++ b/src/plugins/cppeditor/cppelementevaluator.h
@@ -45,7 +45,7 @@ class LookupItem;
class LookupContext;
}
-namespace CppTools { class CppModelManagerInterface; }
+namespace CppTools { class CppModelManager; }
namespace CppEditor {
namespace Internal {
@@ -79,7 +79,7 @@ private:
const CPlusPlus::Scope *scope);
TextEditor::BaseTextEditorWidget *m_editor;
- CppTools::CppModelManagerInterface *m_modelManager;
+ CppTools::CppModelManager *m_modelManager;
QTextCursor m_tc;
bool m_lookupBaseClasses;
bool m_lookupDerivedClasses;
diff --git a/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp b/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp
index e5edad749c..3ab538124b 100644
--- a/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp
+++ b/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp
@@ -38,7 +38,7 @@
#include <cplusplus/ResolveExpression.h>
#include <cplusplus/SimpleLexer.h>
#include <cplusplus/TypeOfExpression.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cpptools/functionutils.h>
#include <cpptools/cpptoolsreuse.h>
#include <cpptools/symbolfinder.h>
@@ -236,7 +236,7 @@ Link findMacroLink(const QByteArray &name, const Document::Ptr &doc)
{
if (!name.isEmpty()) {
if (doc) {
- const Snapshot snapshot = CppModelManagerInterface::instance()->snapshot();
+ const Snapshot snapshot = CppModelManager::instance()->snapshot();
QSet<QString> processed;
return findMacroLink_helper(name, doc, snapshot, &processed);
}
@@ -597,9 +597,9 @@ BaseTextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &
return link; //already on definition!
} else if (const Document::MacroUse *use = doc->findMacroUseAt(endOfToken - 1)) {
const QString fileName = use->macro().fileName();
- if (fileName == CppModelManagerInterface::editorConfigurationFileName()) {
+ if (fileName == CppModelManager::editorConfigurationFileName()) {
m_widget->showPreProcessorWidget();
- } else if (fileName != CppModelManagerInterface::configurationFileName()) {
+ } else if (fileName != CppModelManager::configurationFileName()) {
const Macro &macro = use->macro();
link.targetFileName = macro.fileName();
link.targetLine = macro.line();
diff --git a/src/plugins/cppeditor/cppincludehierarchy_test.cpp b/src/plugins/cppeditor/cppincludehierarchy_test.cpp
index 8eaba08c0a..6eb4b78c05 100644
--- a/src/plugins/cppeditor/cppincludehierarchy_test.cpp
+++ b/src/plugins/cppeditor/cppincludehierarchy_test.cpp
@@ -32,7 +32,7 @@
#include "cppincludehierarchymodel.h"
#include <coreplugin/editormanager/editormanager.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <utils/fileutils.h>
#include <QByteArray>
diff --git a/src/plugins/cppeditor/cppincludehierarchymodel.cpp b/src/plugins/cppeditor/cppincludehierarchymodel.cpp
index 0dfde59238..12299f8628 100644
--- a/src/plugins/cppeditor/cppincludehierarchymodel.cpp
+++ b/src/plugins/cppeditor/cppincludehierarchymodel.cpp
@@ -33,7 +33,7 @@
#include <coreplugin/fileiconprovider.h>
#include <cpptools/builtineditordocumentparser.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cpptools/editordocumenthandle.h>
#include <texteditor/basetexteditor.h>
@@ -48,7 +48,7 @@ namespace {
Snapshot globalSnapshot()
{
- return CppTools::CppModelManagerInterface::instance()->snapshot();
+ return CppTools::CppModelManager::instance()->snapshot();
}
} // anonymous namespace
diff --git a/src/plugins/cppeditor/cpppreprocessordialog.h b/src/plugins/cppeditor/cpppreprocessordialog.h
index bdb46d86f3..c24cefc3d0 100644
--- a/src/plugins/cppeditor/cpppreprocessordialog.h
+++ b/src/plugins/cppeditor/cpppreprocessordialog.h
@@ -30,7 +30,7 @@
#ifndef CPPPREPROCESSORDIALOG_H
#define CPPPREPROCESSORDIALOG_H
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <QDialog>
diff --git a/src/plugins/cppeditor/cppquickfixassistant.cpp b/src/plugins/cppeditor/cppquickfixassistant.cpp
index 9331023dc1..a0d1a148a3 100644
--- a/src/plugins/cppeditor/cppquickfixassistant.cpp
+++ b/src/plugins/cppeditor/cppquickfixassistant.cpp
@@ -91,7 +91,7 @@ CppQuickFixAssistInterface::CppQuickFixAssistInterface(CppEditorWidget *editor,
editor->textDocument()->filePath(), reason)
, m_editor(editor)
, m_semanticInfo(editor->semanticInfo())
- , m_snapshot(CppTools::CppModelManagerInterface::instance()->snapshot())
+ , m_snapshot(CppTools::CppModelManager::instance()->snapshot())
, m_currentFile(CppRefactoringChanges::file(editor, m_semanticInfo.doc))
, m_context(m_semanticInfo.doc, m_snapshot)
{
diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp
index a4913b1bab..28c52f0b47 100644
--- a/src/plugins/cppeditor/cppquickfixes.cpp
+++ b/src/plugins/cppeditor/cppquickfixes.cpp
@@ -1901,7 +1901,7 @@ void AddIncludeForUndefinedIdentifier::match(const CppQuickFixInterface &interfa
// find the include paths
ProjectPart::HeaderPaths headerPaths;
- CppModelManagerInterface *modelManager = CppModelManagerInterface::instance();
+ CppModelManager *modelManager = CppModelManager::instance();
QList<ProjectInfo> projectInfos = modelManager->projectInfos();
bool inProject = false;
foreach (const ProjectInfo &info, projectInfos) {
diff --git a/src/plugins/cppeditor/cppuseselectionsupdater.cpp b/src/plugins/cppeditor/cppuseselectionsupdater.cpp
index cfc8bce807..a6ba70d05c 100644
--- a/src/plugins/cppeditor/cppuseselectionsupdater.cpp
+++ b/src/plugins/cppeditor/cppuseselectionsupdater.cpp
@@ -33,7 +33,7 @@
#include "cppeditor.h"
#include <cpptools/cpplocalsymbols.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cpptools/cpptoolsreuse.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/convenience.h>
@@ -204,7 +204,7 @@ QList<int> findReferences(const Params &p)
using CppEditor::Internal::CanonicalSymbol;
if (Symbol *s = CanonicalSymbol::canonicalSymbol(p.scope, p.expression, typeOfExpression)) {
- CppTools::CppModelManagerInterface *mmi = CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *mmi = CppTools::CppModelManager::instance();
result = mmi->references(s, typeOfExpression.context());
}
diff --git a/src/plugins/cppeditor/fileandtokenactions_test.cpp b/src/plugins/cppeditor/fileandtokenactions_test.cpp
index 8422664826..2bfccaead7 100644
--- a/src/plugins/cppeditor/fileandtokenactions_test.cpp
+++ b/src/plugins/cppeditor/fileandtokenactions_test.cpp
@@ -36,7 +36,7 @@
#include "cppinsertvirtualmethods.h"
#include <coreplugin/editormanager/editormanager.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cpptools/cpptoolsreuse.h>
#include <cpptools/cppworkingcopy.h>
#include <projectexplorer/project.h>
diff --git a/src/plugins/cpptools/abstracteditorsupport.cpp b/src/plugins/cpptools/abstracteditorsupport.cpp
index d1abe0ff79..3151513073 100644
--- a/src/plugins/cpptools/abstracteditorsupport.cpp
+++ b/src/plugins/cpptools/abstracteditorsupport.cpp
@@ -30,14 +30,14 @@
#include "abstracteditorsupport.h"
#include "cppfilesettingspage.h"
-#include "cppmodelmanagerinterface.h"
+#include "cppmodelmanager.h"
#include <cplusplus/Overview.h>
#include <QDebug>
namespace CppTools {
-AbstractEditorSupport::AbstractEditorSupport(CppModelManagerInterface *modelmanager) :
+AbstractEditorSupport::AbstractEditorSupport(CppModelManager *modelmanager) :
m_modelmanager(modelmanager), m_revision(1)
{
}
@@ -52,7 +52,7 @@ void AbstractEditorSupport::updateDocument()
m_modelmanager->updateSourceFiles(QSet<QString>() << fileName());
}
-QString AbstractEditorSupport::functionAt(const CppModelManagerInterface *modelManager,
+QString AbstractEditorSupport::functionAt(const CppModelManager *modelManager,
const QString &fileName,
int line, int column)
{
diff --git a/src/plugins/cpptools/abstracteditorsupport.h b/src/plugins/cpptools/abstracteditorsupport.h
index a8afc450d6..06089824ff 100644
--- a/src/plugins/cpptools/abstracteditorsupport.h
+++ b/src/plugins/cpptools/abstracteditorsupport.h
@@ -36,13 +36,13 @@
#include <QObject>
namespace CppTools {
-class CppModelManagerInterface;
+class CppModelManager;
class CPPTOOLS_EXPORT AbstractEditorSupport : public QObject
{
Q_OBJECT
public:
- explicit AbstractEditorSupport(CppModelManagerInterface *modelmanager);
+ explicit AbstractEditorSupport(CppModelManager *modelmanager);
virtual ~AbstractEditorSupport();
/// \returns the contents, encoded as UTF-8
@@ -53,14 +53,14 @@ public:
unsigned revision() const { return m_revision; }
// TODO: find a better place for common utility functions
- static QString functionAt(const CppModelManagerInterface *mm,
+ static QString functionAt(const CppModelManager *mm,
const QString &fileName,
int line, int column);
static QString licenseTemplate(const QString &file = QString(), const QString &className = QString());
private:
- CppModelManagerInterface *m_modelmanager;
+ CppModelManager *m_modelmanager;
unsigned m_revision;
};
diff --git a/src/plugins/cpptools/baseeditordocumentparser.cpp b/src/plugins/cpptools/baseeditordocumentparser.cpp
index bcf7407415..31d65da69b 100644
--- a/src/plugins/cpptools/baseeditordocumentparser.cpp
+++ b/src/plugins/cpptools/baseeditordocumentparser.cpp
@@ -105,7 +105,7 @@ void BaseEditorDocumentParser::setEditorDefines(const QByteArray &editorDefines)
BaseEditorDocumentParser *BaseEditorDocumentParser::get(const QString &filePath)
{
- CppModelManagerInterface *cmmi = CppModelManagerInterface::instance();
+ CppModelManager *cmmi = CppModelManager::instance();
if (EditorDocumentHandle *editorDocument = cmmi->editorDocument(filePath)) {
if (BaseEditorDocumentProcessor *processor = editorDocument->processor())
return processor->parser();
@@ -120,7 +120,7 @@ void BaseEditorDocumentParser::updateProjectPart()
return;
}
- CppModelManagerInterface *cmm = CppModelManagerInterface::instance();
+ CppModelManager *cmm = CppModelManager::instance();
QList<ProjectPart::Ptr> projectParts = cmm->projectPart(m_filePath);
if (projectParts.isEmpty()) {
if (m_projectPart)
diff --git a/src/plugins/cpptools/baseeditordocumentparser.h b/src/plugins/cpptools/baseeditordocumentparser.h
index d33b88a8ab..328ecd123d 100644
--- a/src/plugins/cpptools/baseeditordocumentparser.h
+++ b/src/plugins/cpptools/baseeditordocumentparser.h
@@ -30,7 +30,7 @@
#ifndef BASEEDITORDOCUMENTPARSER_H
#define BASEEDITORDOCUMENTPARSER_H
-#include "cppmodelmanagerinterface.h"
+#include "cppmodelmanager.h"
#include "cpptools_global.h"
#include <QObject>
diff --git a/src/plugins/cpptools/baseeditordocumentprocessor.cpp b/src/plugins/cpptools/baseeditordocumentprocessor.cpp
index f8353707fb..bde9d5183a 100644
--- a/src/plugins/cpptools/baseeditordocumentprocessor.cpp
+++ b/src/plugins/cpptools/baseeditordocumentprocessor.cpp
@@ -64,7 +64,7 @@ TextEditor::BaseTextDocument *BaseEditorDocumentProcessor::baseTextDocument() co
BaseEditorDocumentProcessor *BaseEditorDocumentProcessor::get(const QString &filePath)
{
- CppModelManagerInterface *cmmi = CppModelManagerInterface::instance();
+ CppModelManager *cmmi = CppModelManager::instance();
if (EditorDocumentHandle *editorDocument = cmmi->editorDocument(filePath))
return editorDocument->processor();
return 0;
@@ -126,7 +126,7 @@ void BaseEditorDocumentProcessor::runParser(QFutureInterface<void> &future,
}
parser->update(workingCopy);
- CppModelManagerInterface::instance()
+ CppModelManager::instance()
->finishedRefreshingSourceFiles(QSet<QString>() << parser->filePath());
future.setProgressValue(1);
diff --git a/src/plugins/cpptools/builtineditordocumentparser.cpp b/src/plugins/cpptools/builtineditordocumentparser.cpp
index e6b5fd3c75..a251c59c3d 100644
--- a/src/plugins/cpptools/builtineditordocumentparser.cpp
+++ b/src/plugins/cpptools/builtineditordocumentparser.cpp
@@ -54,8 +54,7 @@ void BuiltinEditorDocumentParser::update(WorkingCopy workingCopy)
bool invalidateSnapshot = false, invalidateConfig = false, editorDefinesChanged_ = false;
- CppModelManager *modelManager
- = dynamic_cast<CppModelManager *>(CppModelManagerInterface::instance());
+ CppModelManager *modelManager = CppModelManager::instance();
QByteArray configFile = modelManager->codeModelConfiguration();
ProjectPart::HeaderPaths headerPaths;
QStringList precompiledHeaders;
@@ -146,7 +145,7 @@ void BuiltinEditorDocumentParser::update(WorkingCopy workingCopy)
m_snapshot.remove(filePath());
static const QString editorDefinesFileName
- = CppModelManagerInterface::editorConfigurationFileName();
+ = CppModelManager::editorConfigurationFileName();
if (editorDefinesChanged_) {
m_snapshot.remove(editorDefinesFileName);
workingCopy.insert(editorDefinesFileName, editorDefines());
diff --git a/src/plugins/cpptools/builtineditordocumentprocessor.cpp b/src/plugins/cpptools/builtineditordocumentprocessor.cpp
index d2f8a2652e..74c8d26cc6 100644
--- a/src/plugins/cpptools/builtineditordocumentprocessor.cpp
+++ b/src/plugins/cpptools/builtineditordocumentprocessor.cpp
@@ -49,11 +49,6 @@ enum { debug = 0 };
namespace {
-CppTools::Internal::CppModelManager *cmm()
-{
- return CppTools::Internal::CppModelManager::instance();
-}
-
QFuture<TextEditor::HighlightingResult> runHighlighter(const CPlusPlus::Document::Ptr &doc,
const CPlusPlus::Snapshot &snapshot,
QTextDocument *textDocument)
@@ -164,7 +159,7 @@ BuiltinEditorDocumentProcessor::~BuiltinEditorDocumentProcessor()
void BuiltinEditorDocumentProcessor::run()
{
- m_parserFuture = QtConcurrent::run(&runParser, parser(), cmm()->workingCopy());
+ m_parserFuture = QtConcurrent::run(&runParser, parser(), CppTools::CppModelManager::instance()->workingCopy());
}
BaseEditorDocumentParser *BuiltinEditorDocumentProcessor::parser()
@@ -237,7 +232,7 @@ void BuiltinEditorDocumentProcessor::onSemanticInfoUpdated(const SemanticInfo se
SemanticInfo::Source BuiltinEditorDocumentProcessor::createSemanticInfoSource(bool force) const
{
- const WorkingCopy workingCopy = cmm()->workingCopy();
+ const WorkingCopy workingCopy = CppTools::CppModelManager::instance()->workingCopy();
const QString path = filePath();
return SemanticInfo::Source(path,
workingCopy.source(path),
diff --git a/src/plugins/cpptools/builtinindexingsupport.cpp b/src/plugins/cpptools/builtinindexingsupport.cpp
index 295afead9c..689a08df85 100644
--- a/src/plugins/cpptools/builtinindexingsupport.cpp
+++ b/src/plugins/cpptools/builtinindexingsupport.cpp
@@ -209,7 +209,7 @@ void index(QFutureInterface<void> &future, const ParseParams params)
sourceProcessor->setTodo(files.toSet());
- const QString conf = CppModelManagerInterface::configurationFileName();
+ const QString conf = CppModelManager::configurationFileName();
bool processingHeaders = false;
CppModelManager *cmm = CppModelManager::instance();
@@ -354,7 +354,7 @@ BuiltinIndexingSupport::~BuiltinIndexingSupport()
{}
QFuture<void> BuiltinIndexingSupport::refreshSourceFiles(const QSet<QString> &sourceFiles,
- CppModelManagerInterface::ProgressNotificationMode mode)
+ CppModelManager::ProgressNotificationMode mode)
{
CppModelManager *mgr = CppModelManager::instance();
@@ -379,7 +379,7 @@ QFuture<void> BuiltinIndexingSupport::refreshSourceFiles(const QSet<QString> &so
m_synchronizer.addFuture(result);
- if (mode == CppModelManagerInterface::ForcedProgressNotification || sourceFiles.count() > 1) {
+ if (mode == CppModelManager::ForcedProgressNotification || sourceFiles.count() > 1) {
Core::ProgressManager::addTask(result, QCoreApplication::translate("CppTools::Internal::BuiltinIndexingSupport", "Parsing C/C++ Files"),
CppTools::Constants::TASK_INDEX);
}
diff --git a/src/plugins/cpptools/builtinindexingsupport.h b/src/plugins/cpptools/builtinindexingsupport.h
index a9a5d31d68..f921729ac7 100644
--- a/src/plugins/cpptools/builtinindexingsupport.h
+++ b/src/plugins/cpptools/builtinindexingsupport.h
@@ -31,7 +31,7 @@
#define BUILTININDEXINGSUPPORT_H
#include "cppindexingsupport.h"
-#include "cppmodelmanagerinterface.h"
+#include "cppmodelmanager.h"
#include <QFutureSynchronizer>
@@ -44,7 +44,7 @@ public:
~BuiltinIndexingSupport();
virtual QFuture<void> refreshSourceFiles(const QSet<QString> &sourceFiles,
- CppModelManagerInterface::ProgressNotificationMode mode);
+ CppModelManager::ProgressNotificationMode mode);
virtual SymbolSearcher *createSymbolSearcher(SymbolSearcher::Parameters parameters,
QSet<QString> fileNames);
diff --git a/src/plugins/cpptools/cppcodemodelinspectordumper.cpp b/src/plugins/cpptools/cppcodemodelinspectordumper.cpp
index 7f0d03932b..858f9bd409 100644
--- a/src/plugins/cpptools/cppcodemodelinspectordumper.cpp
+++ b/src/plugins/cpptools/cppcodemodelinspectordumper.cpp
@@ -384,7 +384,7 @@ QString Utils::toString(CPlusPlus::Kind kind)
QString Utils::partsForFile(const QString &fileName)
{
const QList<ProjectPart::Ptr> parts
- = CppModelManagerInterface::instance()->projectPart(fileName);
+ = CppModelManager::instance()->projectPart(fileName);
QString result;
foreach (const ProjectPart::Ptr &part, parts)
result += part->displayName + QLatin1Char(',');
diff --git a/src/plugins/cpptools/cppcodemodelinspectordumper.h b/src/plugins/cpptools/cppcodemodelinspectordumper.h
index 0226ef5de5..972d479eca 100644
--- a/src/plugins/cpptools/cppcodemodelinspectordumper.h
+++ b/src/plugins/cpptools/cppcodemodelinspectordumper.h
@@ -32,7 +32,7 @@
#include "cpptools_global.h"
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cplusplus/CppDocument.h>
#include <QFile>
diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp
index c45f159d66..703a3aaff5 100644
--- a/src/plugins/cpptools/cppcompletionassist.cpp
+++ b/src/plugins/cpptools/cppcompletionassist.cpp
@@ -32,7 +32,7 @@
#include "builtineditordocumentparser.h"
#include "cppdoxygen.h"
#include "cppmodelmanager.h"
-#include "cppmodelmanagerinterface.h"
+#include "cppmodelmanager.h"
#include "cpptoolsconstants.h"
#include "cpptoolsreuse.h"
#include "editordocumenthandle.h"
@@ -422,7 +422,7 @@ AssistInterface *InternalCompletionAssistProvider::createAssistInterface(
{
QTC_ASSERT(document, return 0);
- CppModelManagerInterface *modelManager = CppModelManagerInterface::instance();
+ CppModelManager *modelManager = CppModelManager::instance();
return new CppTools::Internal::CppCompletionAssistInterface(filePath, document, isObjCEnabled,
position, reason,
modelManager->workingCopy());
@@ -1383,7 +1383,7 @@ void CppCompletionAssistProcessor::globalCompletion(CPlusPlus::Scope *currentSco
completeNamespace(b);
addKeywords();
- addMacros(CppModelManagerInterface::configurationFileName(), context.snapshot());
+ addMacros(CppModelManager::configurationFileName(), context.snapshot());
addMacros(context.thisDocument()->fileName(), context.snapshot());
addSnippets();
}
diff --git a/src/plugins/cpptools/cppcompletionassist.h b/src/plugins/cpptools/cppcompletionassist.h
index 1eff1bd59f..5254acd7ef 100644
--- a/src/plugins/cpptools/cppcompletionassist.h
+++ b/src/plugins/cpptools/cppcompletionassist.h
@@ -31,7 +31,7 @@
#define CPPCOMPLETIONASSIST_H
#include "cppcompletionassistprovider.h"
-#include "cppmodelmanagerinterface.h"
+#include "cppmodelmanager.h"
#include "cppworkingcopy.h"
#include <cplusplus/Icons.h>
diff --git a/src/plugins/cpptools/cppcurrentdocumentfilter.h b/src/plugins/cpptools/cppcurrentdocumentfilter.h
index 06b9633d71..9f2a729d4e 100644
--- a/src/plugins/cpptools/cppcurrentdocumentfilter.h
+++ b/src/plugins/cpptools/cppcurrentdocumentfilter.h
@@ -36,10 +36,11 @@
namespace Core { class IEditor; }
namespace CppTools {
-namespace Internal {
class CppModelManager;
+namespace Internal {
+
class CppCurrentDocumentFilter : public Core::ILocatorFilter
{
Q_OBJECT
diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp
index ad8ec3f0d1..ccde50baef 100644
--- a/src/plugins/cpptools/cppfindreferences.cpp
+++ b/src/plugins/cpptools/cppfindreferences.cpp
@@ -30,7 +30,7 @@
#include "cppfindreferences.h"
#include "cpptoolsconstants.h"
-#include "cppmodelmanagerinterface.h"
+#include "cppmodelmanager.h"
#include "cppworkingcopy.h"
#include <coreplugin/editormanager/editormanager.h>
@@ -246,7 +246,7 @@ public:
} // end of anonymous namespace
-CppFindReferences::CppFindReferences(CppModelManagerInterface *modelManager)
+CppFindReferences::CppFindReferences(CppModelManager *modelManager)
: QObject(modelManager),
m_modelManager(modelManager)
{
@@ -391,7 +391,7 @@ void CppFindReferences::searchAgain()
{
Core::SearchResult *search = qobject_cast<Core::SearchResult *>(sender());
CppFindReferencesParameters parameters = search->userData().value<CppFindReferencesParameters>();
- Snapshot snapshot = CppModelManagerInterface::instance()->snapshot();
+ Snapshot snapshot = CppModelManager::instance()->snapshot();
search->restart();
LookupContext context;
Symbol *symbol = findSymbol(parameters, snapshot, &context);
diff --git a/src/plugins/cpptools/cppfindreferences.h b/src/plugins/cpptools/cppfindreferences.h
index 07e43f2430..26edcfcaf4 100644
--- a/src/plugins/cpptools/cppfindreferences.h
+++ b/src/plugins/cpptools/cppfindreferences.h
@@ -46,7 +46,7 @@ class SearchResult;
} // namespace Core
namespace CppTools {
-class CppModelManagerInterface;
+class CppModelManager;
namespace Internal {
@@ -62,7 +62,7 @@ class CppFindReferences: public QObject
Q_OBJECT
public:
- CppFindReferences(CppModelManagerInterface *modelManager);
+ CppFindReferences(CppModelManager *modelManager);
virtual ~CppFindReferences();
QList<int> references(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context) const;
@@ -96,7 +96,7 @@ private:
const CPlusPlus::Snapshot &snapshot, CPlusPlus::LookupContext *context);
private:
- QPointer<CppModelManagerInterface> m_modelManager;
+ QPointer<CppModelManager> m_modelManager;
QMap<QFutureWatcher<CPlusPlus::Usage> *, QPointer<Core::SearchResult> > m_watchers;
};
diff --git a/src/plugins/cpptools/cppindexingsupport.h b/src/plugins/cpptools/cppindexingsupport.h
index b31e5072a2..f9422e3c48 100644
--- a/src/plugins/cpptools/cppindexingsupport.h
+++ b/src/plugins/cpptools/cppindexingsupport.h
@@ -32,7 +32,7 @@
#include "cpptools_global.h"
-#include "cppmodelmanagerinterface.h"
+#include "cppmodelmanager.h"
#include <coreplugin/find/searchresultwindow.h>
#include <coreplugin/find/textfindconstants.h>
@@ -83,7 +83,7 @@ public:
virtual ~CppIndexingSupport() = 0;
virtual QFuture<void> refreshSourceFiles(const QSet<QString> &sourceFiles,
- CppModelManagerInterface::ProgressNotificationMode mode) = 0;
+ CppModelManager::ProgressNotificationMode mode) = 0;
virtual SymbolSearcher *createSymbolSearcher(SymbolSearcher::Parameters parameters,
QSet<QString> fileNames) = 0;
};
diff --git a/src/plugins/cpptools/cpplocatorfilter.h b/src/plugins/cpptools/cpplocatorfilter.h
index dbf7eed6f0..7b96bd93b6 100644
--- a/src/plugins/cpptools/cpplocatorfilter.h
+++ b/src/plugins/cpptools/cpplocatorfilter.h
@@ -38,8 +38,6 @@
namespace CppTools {
namespace Internal {
-class CppModelManager;
-
class CppLocatorFilter : public Core::ILocatorFilter
{
Q_OBJECT
diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp
index 801686746b..4ac45b831e 100644
--- a/src/plugins/cpptools/cppmodelmanager.cpp
+++ b/src/plugins/cpptools/cppmodelmanager.cpp
@@ -110,7 +110,53 @@ protected:
#endif // QTCREATOR_WITH_DUMP_AST
-static const char pp_configuration[] =
+namespace CppTools {
+namespace Internal {
+
+static QMutex m_instanceMutex;
+static CppModelManager *m_instance;
+
+class CppModelManagerPrivate
+{
+public:
+ // Snapshot
+ mutable QMutex m_snapshotMutex;
+ CPlusPlus::Snapshot m_snapshot;
+
+ // Project integration
+ mutable QMutex m_projectMutex;
+ QMap<ProjectExplorer::Project *, ProjectInfo> m_projectToProjectsInfo;
+ QMap<QString, QList<CppTools::ProjectPart::Ptr> > m_fileToProjectParts;
+ QMap<QString, CppTools::ProjectPart::Ptr> m_projectFileToProjectPart;
+ // The members below are cached/(re)calculated from the projects and/or their project parts
+ bool m_dirty;
+ QStringList m_projectFiles;
+ ProjectPart::HeaderPaths m_headerPaths;
+ QByteArray m_definedMacros;
+
+ // Editor integration
+ mutable QMutex m_cppEditorsMutex;
+ QMap<QString, EditorDocumentHandle *> m_cppEditors;
+ QSet<AbstractEditorSupport *> m_extraEditorSupports;
+
+ // Completion & highlighting
+ QHash<QString, ModelManagerSupport *> m_idTocodeModelSupporter;
+ QScopedPointer<ModelManagerSupport> m_modelManagerSupportFallback;
+
+ // Indexing
+ CppIndexingSupport *m_indexingSupporter;
+ CppIndexingSupport *m_internalIndexingSupport;
+ bool m_indexerEnabled;
+
+ CppFindReferences *m_findReferences;
+
+ bool m_enableGC;
+ QTimer m_delayedGcTimer;
+};
+
+} // namespace Internal
+
+const char pp_configuration[] =
"# 1 \"<configuration>\"\n"
"#define Q_CREATOR_RUN 1\n"
"#define __cplusplus 1\n"
@@ -179,6 +225,16 @@ CppSourceProcessor *CppModelManager::createSourceProcessor()
});
}
+QString CppModelManager::editorConfigurationFileName()
+{
+ return QLatin1String("<per-editor-defines>");
+}
+
+QString CppModelManager::configurationFileName()
+{
+ return CPlusPlus::Preprocessor::configurationFileName;
+}
+
void CppModelManager::updateModifiedSourceFiles()
{
const Snapshot snapshot = this->snapshot();
@@ -201,9 +257,6 @@ void CppModelManager::updateModifiedSourceFiles()
* Files are garbage collected
*/
-QMutex CppModelManager::m_instanceMutex;
-CppModelManager *CppModelManager::m_instance = 0;
-
CppModelManager *CppModelManager::instance()
{
if (m_instance)
@@ -217,23 +270,23 @@ CppModelManager *CppModelManager::instance()
}
CppModelManager::CppModelManager(QObject *parent)
- : CppModelManagerInterface(parent)
- , m_indexingSupporter(0)
- , m_enableGC(true)
+ : CppModelManagerBase(parent), d(new CppModelManagerPrivate)
{
+ d->m_indexingSupporter = 0;
+ d->m_enableGC = true;
+
qRegisterMetaType<QSet<QString> >();
connect(this, SIGNAL(sourceFilesRefreshed(QSet<QString>)),
this, SLOT(onSourceFilesRefreshed()));
- m_findReferences = new CppFindReferences(this);
- m_indexerEnabled = qgetenv("QTC_NO_CODE_INDEXER") != "1";
+ d->m_findReferences = new CppFindReferences(this);
+ d->m_indexerEnabled = qgetenv("QTC_NO_CODE_INDEXER") != "1";
- m_dirty = true;
+ d->m_dirty = true;
- m_delayedGcTimer = new QTimer(this);
- m_delayedGcTimer->setObjectName(QLatin1String("CppModelManager::m_delayedGcTimer"));
- m_delayedGcTimer->setSingleShot(true);
- connect(m_delayedGcTimer, SIGNAL(timeout()), this, SLOT(GC()));
+ d->m_delayedGcTimer.setObjectName(QLatin1String("CppModelManager::m_delayedGcTimer"));
+ d->m_delayedGcTimer.setSingleShot(true);
+ connect(&d->m_delayedGcTimer, SIGNAL(timeout()), this, SLOT(GC()));
QObject *sessionManager = ProjectExplorer::SessionManager::instance();
connect(sessionManager, SIGNAL(projectAdded(ProjectExplorer::Project*)),
@@ -250,29 +303,30 @@ CppModelManager::CppModelManager(QObject *parent)
qRegisterMetaType<CPlusPlus::Document::Ptr>("CPlusPlus::Document::Ptr");
- m_modelManagerSupportFallback.reset(new ModelManagerSupportInternal);
+ d->m_modelManagerSupportFallback.reset(new ModelManagerSupportInternal);
CppToolsPlugin::instance()->codeModelSettings()->setDefaultId(
- m_modelManagerSupportFallback->id());
- addModelManagerSupport(m_modelManagerSupportFallback.data());
+ d->m_modelManagerSupportFallback->id());
+ addModelManagerSupport(d->m_modelManagerSupportFallback.data());
- m_internalIndexingSupport = new BuiltinIndexingSupport;
+ d->m_internalIndexingSupport = new BuiltinIndexingSupport;
}
CppModelManager::~CppModelManager()
{
- delete m_internalIndexingSupport;
+ delete d;
+ delete d->m_internalIndexingSupport;
}
Snapshot CppModelManager::snapshot() const
{
- QMutexLocker locker(&m_snapshotMutex);
- return m_snapshot;
+ QMutexLocker locker(&d->m_snapshotMutex);
+ return d->m_snapshot;
}
Document::Ptr CppModelManager::document(const QString &fileName) const
{
- QMutexLocker locker(&m_snapshotMutex);
- return m_snapshot.document(fileName);
+ QMutexLocker locker(&d->m_snapshotMutex);
+ return d->m_snapshot.document(fileName);
}
/// Replace the document in the snapshot.
@@ -280,33 +334,33 @@ Document::Ptr CppModelManager::document(const QString &fileName) const
/// \returns true if successful, false if the new document is out-dated.
bool CppModelManager::replaceDocument(Document::Ptr newDoc)
{
- QMutexLocker locker(&m_snapshotMutex);
+ QMutexLocker locker(&d->m_snapshotMutex);
- Document::Ptr previous = m_snapshot.document(newDoc->fileName());
+ Document::Ptr previous = d->m_snapshot.document(newDoc->fileName());
if (previous && (newDoc->revision() != 0 && newDoc->revision() < previous->revision()))
// the new document is outdated
return false;
- m_snapshot.insert(newDoc);
+ d->m_snapshot.insert(newDoc);
return true;
}
void CppModelManager::ensureUpdated()
{
- QMutexLocker locker(&m_projectMutex);
- if (!m_dirty)
+ QMutexLocker locker(&d->m_projectMutex);
+ if (!d->m_dirty)
return;
- m_projectFiles = internalProjectFiles();
- m_headerPaths = internalHeaderPaths();
- m_definedMacros = internalDefinedMacros();
- m_dirty = false;
+ d->m_projectFiles = internalProjectFiles();
+ d->m_headerPaths = internalHeaderPaths();
+ d->m_definedMacros = internalDefinedMacros();
+ d->m_dirty = false;
}
QStringList CppModelManager::internalProjectFiles() const
{
QStringList files;
- QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(m_projectToProjectsInfo);
+ QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(d->m_projectToProjectsInfo);
while (it.hasNext()) {
it.next();
const ProjectInfo pinfo = it.value();
@@ -322,7 +376,7 @@ QStringList CppModelManager::internalProjectFiles() const
ProjectPart::HeaderPaths CppModelManager::internalHeaderPaths() const
{
ProjectPart::HeaderPaths headerPaths;
- QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(m_projectToProjectsInfo);
+ QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(d->m_projectToProjectsInfo);
while (it.hasNext()) {
it.next();
const ProjectInfo pinfo = it.value();
@@ -358,7 +412,7 @@ QByteArray CppModelManager::internalDefinedMacros() const
{
QByteArray macros;
QSet<QByteArray> alreadyIn;
- QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(m_projectToProjectsInfo);
+ QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(d->m_projectToProjectsInfo);
while (it.hasNext()) {
it.next();
const ProjectInfo pinfo = it.value();
@@ -384,25 +438,25 @@ void CppModelManager::dumpModelManagerConfiguration(const QString &logFileId)
dumper.dumpSnapshot(globalSnapshot, globalSnapshotTitle, /*isGlobalSnapshot=*/ true);
dumper.dumpWorkingCopy(workingCopy());
ensureUpdated();
- dumper.dumpMergedEntities(m_headerPaths, m_definedMacros);
+ dumper.dumpMergedEntities(d->m_headerPaths, d->m_definedMacros);
}
void CppModelManager::addExtraEditorSupport(AbstractEditorSupport *editorSupport)
{
- m_extraEditorSupports.insert(editorSupport);
+ d->m_extraEditorSupports.insert(editorSupport);
}
void CppModelManager::removeExtraEditorSupport(AbstractEditorSupport *editorSupport)
{
- m_extraEditorSupports.remove(editorSupport);
+ d->m_extraEditorSupports.remove(editorSupport);
}
EditorDocumentHandle *CppModelManager::editorDocument(const QString &filePath)
{
QTC_ASSERT(!filePath.isEmpty(), return 0);
- QMutexLocker locker(&m_cppEditorsMutex);
- return m_cppEditors.value(filePath, 0);
+ QMutexLocker locker(&d->m_cppEditorsMutex);
+ return d->m_cppEditors.value(filePath, 0);
}
void CppModelManager::registerEditorDocument(EditorDocumentHandle *editorDocument)
@@ -411,9 +465,9 @@ void CppModelManager::registerEditorDocument(EditorDocumentHandle *editorDocumen
const QString filePath = editorDocument->filePath();
QTC_ASSERT(!filePath.isEmpty(), return);
- QMutexLocker locker(&m_cppEditorsMutex);
- QTC_ASSERT(m_cppEditors.value(filePath, 0) == 0, return);
- m_cppEditors.insert(filePath, editorDocument);
+ QMutexLocker locker(&d->m_cppEditorsMutex);
+ QTC_ASSERT(d->m_cppEditors.value(filePath, 0) == 0, return);
+ d->m_cppEditors.insert(filePath, editorDocument);
}
void CppModelManager::unregisterEditorDocument(const QString &filePath)
@@ -424,10 +478,10 @@ void CppModelManager::unregisterEditorDocument(const QString &filePath)
int openCppDocuments = 0;
{
- QMutexLocker locker(&m_cppEditorsMutex);
- QTC_ASSERT(m_cppEditors.value(filePath, 0), return);
- QTC_CHECK(m_cppEditors.remove(filePath) == 1);
- openCppDocuments = m_cppEditors.size();
+ QMutexLocker locker(&d->m_cppEditorsMutex);
+ QTC_ASSERT(d->m_cppEditors.value(filePath, 0), return);
+ QTC_CHECK(d->m_cppEditors.remove(filePath) == 1);
+ openCppDocuments = d->m_cppEditors.size();
}
++closedCppDocuments;
@@ -439,13 +493,13 @@ void CppModelManager::unregisterEditorDocument(const QString &filePath)
QList<int> CppModelManager::references(CPlusPlus::Symbol *symbol, const LookupContext &context)
{
- return m_findReferences->references(symbol, context);
+ return d->m_findReferences->references(symbol, context);
}
void CppModelManager::findUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context)
{
if (symbol->identifier())
- m_findReferences->findUsages(symbol, context);
+ d->m_findReferences->findUsages(symbol, context);
}
void CppModelManager::renameUsages(CPlusPlus::Symbol *symbol,
@@ -453,23 +507,23 @@ void CppModelManager::renameUsages(CPlusPlus::Symbol *symbol,
const QString &replacement)
{
if (symbol->identifier())
- m_findReferences->renameUsages(symbol, context, replacement);
+ d->m_findReferences->renameUsages(symbol, context, replacement);
}
void CppModelManager::findMacroUsages(const CPlusPlus::Macro &macro)
{
- m_findReferences->findMacroUses(macro);
+ d->m_findReferences->findMacroUses(macro);
}
void CppModelManager::renameMacroUsages(const CPlusPlus::Macro &macro, const QString &replacement)
{
- m_findReferences->renameMacroUses(macro, replacement);
+ d->m_findReferences->renameMacroUses(macro, replacement);
}
void CppModelManager::replaceSnapshot(const CPlusPlus::Snapshot &newSnapshot)
{
- QMutexLocker snapshotLocker(&m_snapshotMutex);
- m_snapshot = newSnapshot;
+ QMutexLocker snapshotLocker(&d->m_snapshotMutex);
+ d->m_snapshot = newSnapshot;
}
WorkingCopy CppModelManager::buildWorkingCopyList()
@@ -479,7 +533,7 @@ WorkingCopy CppModelManager::buildWorkingCopyList()
foreach (const EditorDocumentHandle *cppEditor, cppEditors())
workingCopy.insert(cppEditor->filePath(), cppEditor->contents(), cppEditor->revision());
- QSetIterator<AbstractEditorSupport *> it(m_extraEditorSupports);
+ QSetIterator<AbstractEditorSupport *> it(d->m_extraEditorSupports);
while (it.hasNext()) {
AbstractEditorSupport *es = it.next();
workingCopy.insert(es->fileName(), es->contents(), es->revision());
@@ -506,24 +560,24 @@ QByteArray CppModelManager::codeModelConfiguration() const
QFuture<void> CppModelManager::updateSourceFiles(const QSet<QString> &sourceFiles,
ProgressNotificationMode mode)
{
- if (sourceFiles.isEmpty() || !m_indexerEnabled)
+ if (sourceFiles.isEmpty() || !d->m_indexerEnabled)
return QFuture<void>();
- if (m_indexingSupporter)
- m_indexingSupporter->refreshSourceFiles(sourceFiles, mode);
- return m_internalIndexingSupport->refreshSourceFiles(sourceFiles, mode);
+ if (d->m_indexingSupporter)
+ d->m_indexingSupporter->refreshSourceFiles(sourceFiles, mode);
+ return d->m_internalIndexingSupport->refreshSourceFiles(sourceFiles, mode);
}
QList<ProjectInfo> CppModelManager::projectInfos() const
{
- QMutexLocker locker(&m_projectMutex);
- return m_projectToProjectsInfo.values();
+ QMutexLocker locker(&d->m_projectMutex);
+ return d->m_projectToProjectsInfo.values();
}
ProjectInfo CppModelManager::projectInfo(ProjectExplorer::Project *project) const
{
- QMutexLocker locker(&m_projectMutex);
- return m_projectToProjectsInfo.value(project, ProjectInfo(project));
+ QMutexLocker locker(&d->m_projectMutex);
+ return d->m_projectToProjectsInfo.value(project, ProjectInfo(project));
}
/// \brief Remove all files and their includes (recursively) of given ProjectInfo from the snapshot.
@@ -532,29 +586,29 @@ void CppModelManager::removeProjectInfoFilesAndIncludesFromSnapshot(const Projec
if (!projectInfo.isValid())
return;
- QMutexLocker snapshotLocker(&m_snapshotMutex);
+ QMutexLocker snapshotLocker(&d->m_snapshotMutex);
foreach (const ProjectPart::Ptr &projectPart, projectInfo.projectParts()) {
foreach (const ProjectFile &cxxFile, projectPart->files) {
- foreach (const QString &fileName, m_snapshot.allIncludesForDocument(cxxFile.path))
- m_snapshot.remove(fileName);
- m_snapshot.remove(cxxFile.path);
+ foreach (const QString &fileName, d->m_snapshot.allIncludesForDocument(cxxFile.path))
+ d->m_snapshot.remove(fileName);
+ d->m_snapshot.remove(cxxFile.path);
}
}
}
QList<EditorDocumentHandle *> CppModelManager::cppEditors() const
{
- QMutexLocker locker(&m_cppEditorsMutex);
- return m_cppEditors.values();
+ QMutexLocker locker(&d->m_cppEditorsMutex);
+ return d->m_cppEditors.values();
}
/// \brief Remove all given files from the snapshot.
void CppModelManager::removeFilesFromSnapshot(const QSet<QString> &filesToRemove)
{
- QMutexLocker snapshotLocker(&m_snapshotMutex);
+ QMutexLocker snapshotLocker(&d->m_snapshotMutex);
QSetIterator<QString> i(filesToRemove);
while (i.hasNext())
- m_snapshot.remove(i.next());
+ d->m_snapshot.remove(i.next());
}
class ProjectInfoComparer
@@ -626,13 +680,13 @@ private:
/// Make sure that m_projectMutex is locked when calling this.
void CppModelManager::recalculateFileToProjectParts()
{
- m_projectFileToProjectPart.clear();
- m_fileToProjectParts.clear();
- foreach (const ProjectInfo &projectInfo, m_projectToProjectsInfo) {
+ d->m_projectFileToProjectPart.clear();
+ d->m_fileToProjectParts.clear();
+ foreach (const ProjectInfo &projectInfo, d->m_projectToProjectsInfo) {
foreach (const ProjectPart::Ptr &projectPart, projectInfo.projectParts()) {
- m_projectFileToProjectPart[projectPart->projectFile] = projectPart;
+ d->m_projectFileToProjectPart[projectPart->projectFile] = projectPart;
foreach (const ProjectFile &cxxFile, projectPart->files)
- m_fileToProjectParts[cxxFile.path].append(projectPart);
+ d->m_fileToProjectParts[cxxFile.path].append(projectPart);
}
}
@@ -647,13 +701,13 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn
bool filesRemoved = false;
{ // Only hold the mutex for a limited scope, so the dumping afterwards does not deadlock.
- QMutexLocker projectLocker(&m_projectMutex);
+ QMutexLocker projectLocker(&d->m_projectMutex);
ProjectExplorer::Project *project = newProjectInfo.project().data();
const QSet<QString> newSourceFiles = newProjectInfo.sourceFiles();
// Check if we can avoid a full reindexing
- ProjectInfo oldProjectInfo = m_projectToProjectsInfo.value(project);
+ ProjectInfo oldProjectInfo = d->m_projectToProjectsInfo.value(project);
if (oldProjectInfo.isValid()) {
ProjectInfoComparer comparer(oldProjectInfo, newProjectInfo);
if (comparer.nothingChanged())
@@ -666,8 +720,8 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn
// The "configuration file" includes all defines and therefore should be updated
if (comparer.definesChanged()) {
- QMutexLocker snapshotLocker(&m_snapshotMutex);
- m_snapshot.remove(configurationFileName());
+ QMutexLocker snapshotLocker(&d->m_snapshotMutex);
+ d->m_snapshot.remove(configurationFileName());
}
// Otherwise check for added and modified files
@@ -693,8 +747,8 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn
}
// Update Project/ProjectInfo and File/ProjectPart table
- m_dirty = true;
- m_projectToProjectsInfo.insert(project, newProjectInfo);
+ d->m_dirty = true;
+ d->m_projectToProjectsInfo.insert(project, newProjectInfo);
recalculateFileToProjectParts();
} // Mutex scope
@@ -715,13 +769,13 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn
ProjectPart::Ptr CppModelManager::projectPartForProjectFile(const QString &projectFile) const
{
- return m_projectFileToProjectPart.value(projectFile);
+ return d->m_projectFileToProjectPart.value(projectFile);
}
QList<ProjectPart::Ptr> CppModelManager::projectPart(const QString &fileName) const
{
- QMutexLocker locker(&m_projectMutex);
- return m_fileToProjectParts.value(fileName);
+ QMutexLocker locker(&d->m_projectMutex);
+ return d->m_fileToProjectParts.value(fileName);
}
QList<ProjectPart::Ptr> CppModelManager::projectPartFromDependencies(const QString &fileName) const
@@ -729,7 +783,7 @@ QList<ProjectPart::Ptr> CppModelManager::projectPartFromDependencies(const QStri
QSet<ProjectPart::Ptr> parts;
const QStringList deps = snapshot().filesDependingOn(fileName);
foreach (const QString &dep, deps)
- parts.unite(QSet<ProjectPart::Ptr>::fromList(m_fileToProjectParts.value(dep)));
+ parts.unite(QSet<ProjectPart::Ptr>::fromList(d->m_fileToProjectParts.value(dep)));
return parts.values();
}
@@ -738,8 +792,8 @@ ProjectPart::Ptr CppModelManager::fallbackProjectPart() const
{
ProjectPart::Ptr part(new ProjectPart);
- part->projectDefines = m_definedMacros;
- part->headerPaths = m_headerPaths;
+ part->projectDefines = d->m_definedMacros;
+ part->headerPaths = d->m_headerPaths;
part->languageVersion = ProjectPart::CXX14;
part->languageExtensions = ProjectPart::AllExtensions;
part->qtVersion = ProjectPart::Qt5;
@@ -760,22 +814,22 @@ void CppModelManager::emitDocumentUpdated(Document::Ptr doc)
void CppModelManager::onProjectAdded(ProjectExplorer::Project *)
{
- QMutexLocker locker(&m_projectMutex);
- m_dirty = true;
+ QMutexLocker locker(&d->m_projectMutex);
+ d->m_dirty = true;
}
void CppModelManager::delayedGC()
{
- if (m_enableGC)
- m_delayedGcTimer->start(500);
+ if (d->m_enableGC)
+ d->m_delayedGcTimer.start(500);
}
void CppModelManager::onAboutToRemoveProject(ProjectExplorer::Project *project)
{
do {
- QMutexLocker locker(&m_projectMutex);
- m_dirty = true;
- m_projectToProjectsInfo.remove(project);
+ QMutexLocker locker(&d->m_projectMutex);
+ d->m_dirty = true;
+ d->m_projectToProjectsInfo.remove(project);
recalculateFileToProjectParts();
} while (0);
@@ -792,8 +846,8 @@ void CppModelManager::onSourceFilesRefreshed() const
void CppModelManager::onAboutToLoadSession()
{
- if (m_delayedGcTimer->isActive())
- m_delayedGcTimer->stop();
+ if (d->m_delayedGcTimer.isActive())
+ d->m_delayedGcTimer.stop();
GC();
}
@@ -801,21 +855,21 @@ void CppModelManager::onAboutToUnloadSession()
{
Core::ProgressManager::cancelTasks(CppTools::Constants::TASK_INDEX);
do {
- QMutexLocker locker(&m_projectMutex);
- m_projectToProjectsInfo.clear();
+ QMutexLocker locker(&d->m_projectMutex);
+ d->m_projectToProjectsInfo.clear();
recalculateFileToProjectParts();
- m_dirty = true;
+ d->m_dirty = true;
} while (0);
}
void CppModelManager::onCoreAboutToClose()
{
- m_enableGC = false;
+ d->m_enableGC = false;
}
void CppModelManager::GC()
{
- if (!m_enableGC)
+ if (!d->m_enableGC)
return;
// Collect files of CppEditorSupport and AbstractEditorSupport.
@@ -823,7 +877,7 @@ void CppModelManager::GC()
foreach (const EditorDocumentHandle *cppEditor, cppEditors())
filesInEditorSupports << cppEditor->filePath();
- QSetIterator<AbstractEditorSupport *> jt(m_extraEditorSupports);
+ QSetIterator<AbstractEditorSupport *> jt(d->m_extraEditorSupports);
while (jt.hasNext()) {
AbstractEditorSupport *abstractEditorSupport = jt.next();
filesInEditorSupports << abstractEditorSupport->fileName();
@@ -875,16 +929,16 @@ void CppModelManager::finishedRefreshingSourceFiles(const QSet<QString> &files)
void CppModelManager::addModelManagerSupport(ModelManagerSupport *modelManagerSupport)
{
Q_ASSERT(modelManagerSupport);
- m_idTocodeModelSupporter[modelManagerSupport->id()] = modelManagerSupport;
+ d->m_idTocodeModelSupporter[modelManagerSupport->id()] = modelManagerSupport;
QSharedPointer<CppCodeModelSettings> cms = CppToolsPlugin::instance()->codeModelSettings();
- cms->setModelManagerSupports(m_idTocodeModelSupporter.values());
+ cms->setModelManagerSupports(d->m_idTocodeModelSupporter.values());
}
ModelManagerSupport *CppModelManager::modelManagerSupportForMimeType(const QString &mimeType) const
{
QSharedPointer<CppCodeModelSettings> cms = CppToolsPlugin::instance()->codeModelSettings();
const QString &id = cms->modelManagerSupportId(mimeType);
- return m_idTocodeModelSupporter.value(id, m_modelManagerSupportFallback.data());
+ return d->m_idTocodeModelSupporter.value(id, d->m_modelManagerSupportFallback.data());
}
CppCompletionAssistProvider *CppModelManager::completionAssistProvider(const QString &mimeType) const
@@ -909,34 +963,41 @@ BaseEditorDocumentProcessor *CppModelManager::editorDocumentProcessor(
void CppModelManager::setIndexingSupport(CppIndexingSupport *indexingSupport)
{
if (indexingSupport)
- m_indexingSupporter = indexingSupport;
+ d->m_indexingSupporter = indexingSupport;
}
CppIndexingSupport *CppModelManager::indexingSupport()
{
- return m_indexingSupporter ? m_indexingSupporter : m_internalIndexingSupport;
+ return d->m_indexingSupporter ? d->m_indexingSupporter : d->m_internalIndexingSupport;
}
QStringList CppModelManager::projectFiles()
{
ensureUpdated();
- return m_projectFiles;
+ return d->m_projectFiles;
}
ProjectPart::HeaderPaths CppModelManager::headerPaths()
{
ensureUpdated();
- return m_headerPaths;
+ return d->m_headerPaths;
+}
+
+void CppModelManager::setHeaderPaths(const ProjectPart::HeaderPaths &headerPaths)
+{
+ d->m_headerPaths = headerPaths;
}
QByteArray CppModelManager::definedMacros()
{
ensureUpdated();
- return m_definedMacros;
+ return d->m_definedMacros;
}
void CppModelManager::enableGarbageCollector(bool enable)
{
- m_delayedGcTimer->stop();
- m_enableGC = enable;
+ d->m_delayedGcTimer.stop();
+ d->m_enableGC = enable;
}
+
+} // namespace CppTools
diff --git a/src/plugins/cpptools/cppmodelmanager.h b/src/plugins/cpptools/cppmodelmanager.h
index 8b766a3887..2b680ea8e7 100644
--- a/src/plugins/cpptools/cppmodelmanager.h
+++ b/src/plugins/cpptools/cppmodelmanager.h
@@ -30,26 +30,41 @@
#ifndef CPPMODELMANAGER_H
#define CPPMODELMANAGER_H
-#include "cppmodelmanagerinterface.h"
+#include "cpptools_global.h"
+
+#include "cppprojects.h"
#include <projectexplorer/project.h>
#include <texteditor/basetexteditor.h>
-#include <QHash>
-#include <QMutex>
-#include <QTimer>
+#include <cplusplus/CppDocument.h>
+#include <cplusplus/cppmodelmanagerbase.h>
+
+#include <QFuture>
+#include <QObject>
+#include <QStringList>
namespace Core { class IEditor; }
-namespace TextEditor { class BaseTextEditorWidget; }
+namespace CPlusPlus { class LookupContext; }
+namespace ProjectExplorer { class Project; }
+namespace TextEditor { class BaseTextDocument; }
namespace CppTools {
-namespace Internal {
+class AbstractEditorSupport;
+class BaseEditorDocumentProcessor;
+class CppCompletionAssistProvider;
+class EditorDocumentHandle;
+class CppIndexingSupport;
+class ModelManagerSupport;
+class WorkingCopy;
-class CppFindReferences;
+namespace Internal {
class CppSourceProcessor;
+class CppModelManagerPrivate;
+}
-class CppModelManager : public CppTools::CppModelManagerInterface
+class CPPTOOLS_EXPORT CppModelManager : public CPlusPlus::CppModelManagerBase
{
Q_OBJECT
@@ -58,74 +73,77 @@ public:
public:
CppModelManager(QObject *parent = 0);
- virtual ~CppModelManager();
+ ~CppModelManager();
static CppModelManager *instance();
- virtual QFuture<void> updateSourceFiles(const QSet<QString> &sourceFiles,
+ // Documented in source file.
+ enum ProgressNotificationMode {
+ ForcedProgressNotification,
+ ReservedProgressNotification
+ };
+
+ QFuture<void> updateSourceFiles(const QSet<QString> &sourceFiles,
ProgressNotificationMode mode = ReservedProgressNotification);
- virtual WorkingCopy workingCopy() const;
- virtual QByteArray codeModelConfiguration() const;
+ WorkingCopy workingCopy() const;
+ QByteArray codeModelConfiguration() const;
- virtual QList<ProjectInfo> projectInfos() const;
- virtual ProjectInfo projectInfo(ProjectExplorer::Project *project) const;
- virtual QFuture<void> updateProjectInfo(const ProjectInfo &newProjectInfo);
+ QList<ProjectInfo> projectInfos() const;
+ ProjectInfo projectInfo(ProjectExplorer::Project *project) const;
+ QFuture<void> updateProjectInfo(const ProjectInfo &newProjectInfo);
/// \return The project part with the given project file
- virtual ProjectPart::Ptr projectPartForProjectFile(const QString &projectFile) const;
+ ProjectPart::Ptr projectPartForProjectFile(const QString &projectFile) const;
/// \return All project parts that mention the given file name as one of the sources/headers.
- virtual QList<ProjectPart::Ptr> projectPart(const QString &fileName) const;
+ QList<ProjectPart::Ptr> projectPart(const QString &fileName) const;
/// This is a fall-back function: find all files that includes the file directly or indirectly,
/// and return its \c ProjectPart list for use with this file.
- virtual QList<ProjectPart::Ptr> projectPartFromDependencies(const QString &fileName) const;
+ QList<ProjectPart::Ptr> projectPartFromDependencies(const QString &fileName) const;
/// \return A synthetic \c ProjectPart which consists of all defines/includes/frameworks from
/// all loaded projects.
- virtual ProjectPart::Ptr fallbackProjectPart() const;
+ ProjectPart::Ptr fallbackProjectPart() const;
- virtual CPlusPlus::Snapshot snapshot() const;
- virtual Document::Ptr document(const QString &fileName) const;
+ CPlusPlus::Snapshot snapshot() const;
+ Document::Ptr document(const QString &fileName) const;
bool replaceDocument(Document::Ptr newDoc);
void emitDocumentUpdated(CPlusPlus::Document::Ptr doc);
- virtual bool isCppEditor(Core::IEditor *editor) const;
+ bool isCppEditor(Core::IEditor *editor) const;
- virtual void addExtraEditorSupport(AbstractEditorSupport *editorSupport);
- virtual void removeExtraEditorSupport(AbstractEditorSupport *editorSupport);
+ void addExtraEditorSupport(AbstractEditorSupport *editorSupport);
+ void removeExtraEditorSupport(AbstractEditorSupport *editorSupport);
- virtual EditorDocumentHandle *editorDocument(const QString &filePath);
- virtual void registerEditorDocument(EditorDocumentHandle *editorDocument);
- virtual void unregisterEditorDocument(const QString &filePath);
+ EditorDocumentHandle *editorDocument(const QString &filePath);
+ void registerEditorDocument(EditorDocumentHandle *editorDocument);
+ void unregisterEditorDocument(const QString &filePath);
- virtual QList<int> references(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context);
+ QList<int> references(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context);
- virtual void renameUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context,
- const QString &replacement = QString());
- virtual void findUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context);
+ void renameUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context,
+ const QString &replacement = QString());
+ void findUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context);
- virtual void findMacroUsages(const CPlusPlus::Macro &macro);
- virtual void renameMacroUsages(const CPlusPlus::Macro &macro, const QString &replacement);
+ void findMacroUsages(const CPlusPlus::Macro &macro);
+ void renameMacroUsages(const CPlusPlus::Macro &macro, const QString &replacement);
- virtual void finishedRefreshingSourceFiles(const QSet<QString> &files);
+ void finishedRefreshingSourceFiles(const QSet<QString> &files);
- virtual void addModelManagerSupport(ModelManagerSupport *modelManagerSupport);
- virtual ModelManagerSupport *modelManagerSupportForMimeType(const QString &mimeType) const;
- virtual CppCompletionAssistProvider *completionAssistProvider(const QString &mimeType) const;
- virtual BaseEditorDocumentProcessor *editorDocumentProcessor(
- TextEditor::BaseTextDocument *baseTextDocument) const;
+ void addModelManagerSupport(ModelManagerSupport *modelManagerSupport);
+ ModelManagerSupport *modelManagerSupportForMimeType(const QString &mimeType) const;
+ CppCompletionAssistProvider *completionAssistProvider(const QString &mimeType) const;
+ BaseEditorDocumentProcessor *editorDocumentProcessor(
+ TextEditor::BaseTextDocument *baseTextDocument) const;
- virtual void setIndexingSupport(CppIndexingSupport *indexingSupport);
- virtual CppIndexingSupport *indexingSupport();
+ void setIndexingSupport(CppIndexingSupport *indexingSupport);
+ CppIndexingSupport *indexingSupport();
QStringList projectFiles();
ProjectPart::HeaderPaths headerPaths();
// Use this *only* for auto tests
- void setHeaderPaths(const ProjectPart::HeaderPaths &headerPaths)
- {
- m_headerPaths = headerPaths;
- }
+ void setHeaderPaths(const ProjectPart::HeaderPaths &headerPaths);
QByteArray definedMacros();
@@ -133,9 +151,24 @@ public:
static QSet<QString> timeStampModifiedFiles(const QList<Document::Ptr> &documentsToCheck);
- static CppSourceProcessor *createSourceProcessor();
+ static Internal::CppSourceProcessor *createSourceProcessor();
+ static QString configurationFileName();
+ static QString editorConfigurationFileName();
signals:
+ /// Project data might be locked while this is emitted.
+ void aboutToRemoveFiles(const QStringList &files);
+
+ void documentUpdated(CPlusPlus::Document::Ptr doc);
+ void sourceFilesRefreshed(const QSet<QString> &files);
+
+ /// \brief Emitted after updateProjectInfo function is called on the model-manager.
+ ///
+ /// Other classes can use this to get notified when the \c ProjectExplorer has updated the parts.
+ void projectPartsUpdated(ProjectExplorer::Project *project);
+
+ void globalSnapshotChanged();
+
void gcFinished(); // Needed for tests.
public slots:
@@ -171,46 +204,9 @@ private:
void dumpModelManagerConfiguration(const QString &logFileId);
private:
- static QMutex m_instanceMutex;
- static CppModelManager *m_instance;
-
-private:
- // Snapshot
- mutable QMutex m_snapshotMutex;
- CPlusPlus::Snapshot m_snapshot;
-
- // Project integration
- mutable QMutex m_projectMutex;
- QMap<ProjectExplorer::Project *, ProjectInfo> m_projectToProjectsInfo;
- QMap<QString, QList<CppTools::ProjectPart::Ptr> > m_fileToProjectParts;
- QMap<QString, CppTools::ProjectPart::Ptr> m_projectFileToProjectPart;
- // The members below are cached/(re)calculated from the projects and/or their project parts
- bool m_dirty;
- QStringList m_projectFiles;
- ProjectPart::HeaderPaths m_headerPaths;
- QByteArray m_definedMacros;
-
- // Editor integration
- mutable QMutex m_cppEditorsMutex;
- QMap<QString, EditorDocumentHandle *> m_cppEditors;
- QSet<AbstractEditorSupport *> m_extraEditorSupports;
-
- // Completion & highlighting
- QHash<QString, ModelManagerSupport *> m_idTocodeModelSupporter;
- QScopedPointer<ModelManagerSupport> m_modelManagerSupportFallback;
-
- // Indexing
- CppIndexingSupport *m_indexingSupporter;
- CppIndexingSupport *m_internalIndexingSupport;
- bool m_indexerEnabled;
-
- CppFindReferences *m_findReferences;
-
- bool m_enableGC;
- QTimer *m_delayedGcTimer;
+ Internal::CppModelManagerPrivate *d;
};
-} // namespace Internal
} // namespace CppTools
#endif // CPPMODELMANAGER_H
diff --git a/src/plugins/cpptools/cppmodelmanager_test.cpp b/src/plugins/cpptools/cppmodelmanager_test.cpp
index 32c5e5c0bf..1d30e04c0a 100644
--- a/src/plugins/cpptools/cppmodelmanager_test.cpp
+++ b/src/plugins/cpptools/cppmodelmanager_test.cpp
@@ -48,11 +48,9 @@
using namespace CppTools::Internal;
using namespace ProjectExplorer;
+using namespace CppTools;
typedef CPlusPlus::Document Document;
-typedef CppTools::ProjectInfo ProjectInfo;
-typedef CppTools::ProjectPart ProjectPart;
-typedef CppTools::ProjectFile ProjectFile;
Q_DECLARE_METATYPE(QList<ProjectFile>)
@@ -679,7 +677,7 @@ void CppToolsPlugin::test_modelmanager_extraeditorsupport_uiFiles()
// Check working copy.
// An AbstractEditorSupport object should have been added for the ui_* file.
- CppModelManagerInterface *mm = CppModelManagerInterface::instance();
+ CppModelManager *mm = CppModelManager::instance();
WorkingCopy workingCopy = mm->workingCopy();
QCOMPARE(workingCopy.size(), 2); // mm->configurationFileName() and "ui_*.h"
diff --git a/src/plugins/cpptools/cppmodelmanagerinterface.cpp b/src/plugins/cpptools/cppmodelmanagerinterface.cpp
deleted file mode 100644
index a7b5011367..0000000000
--- a/src/plugins/cpptools/cppmodelmanagerinterface.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#include "cppmodelmanagerinterface.h"
-
-#include <cplusplus/pp-engine.h>
-
-using namespace CppTools;
-
-/*!
- \enum CppTools::CppModelManagerInterface::ProgressNotificationMode
-
- This enum type specifies whether a progress bar notification should be
- shown if more than one file is requested to update via
- CppModelManagerInterface::updateSourceFiles().
-
- \value ForcedProgressNotification
- Notify regardless of the number of files requested for update.
- \value ReservedProgressNotification
- Notify only if more than one file is requested for update.
-*/
-
-/*!
- \enum CppTools::CppModelManagerInterface::QtVersion
-
- Allows C++ parser engine to inject headers or change inner settings as
- needed to parse Qt language extensions for concrete major Qt version
-
- \value UnknownQt
- Parser may choose any policy
- \value NoQt
- Parser must not use special tricks, because it parses non-qt project
- \value Qt4
- Parser may enable tricks for Qt v4.x
- \value Qt5
- Parser may enable tricks for Qt v5.x
-*/
-
-/*!
- \fn virtual QFuture<void> updateProjectInfo(const ProjectInfo &pinfo) = 0;
- \param pinfo Updated ProjectInfo.
- \return A future that reports progress and allows to cancel the reparsing operation.
-
- This function is expected to be called by the project managers to update the
- code model with new project information.
-
- In particular, the function should be called in case:
- 1. A new project is opened/created
- 2. The project configuration changed. This includes
- 2.1 Changes of defines, includes, framework paths
- 2.2 Addition/Removal of project files
-
- \sa CppTools::CppModelManagerInterface::updateSourceFiles()
-*/
-
-/*!
- \fn virtual QFuture<void> updateSourceFiles(const QStringList &sourceFiles, ProgressNotificationMode mode = ReservedProgressNotification) = 0;
- \param sourceFiles List of source file to update. The items are absolute paths.
- \param mode The progress modification mode.
- \return A future that reports progress and allows to cancel the reparsing operation.
-
- Trigger an asynchronous reparsing of the given source files.
-
- This function is not meant to be called by the project managers.
-
- \sa CppTools::CppModelManagerInterface::ProgressNotificationMode
- \sa CppTools::CppModelManagerInterface::updateProjectInfo()
-*/
-
-const QString CppModelManagerInterface::configurationFileName()
-{ return CPlusPlus::Preprocessor::configurationFileName; }
-
-const QString CppModelManagerInterface::editorConfigurationFileName()
-{
- return QLatin1String("<per-editor-defines>");
-}
-
-CppModelManagerInterface::CppModelManagerInterface(QObject *parent)
- : CPlusPlus::CppModelManagerBase(parent)
-{ }
-
-CppModelManagerInterface::~CppModelManagerInterface()
-{ }
-
-CppModelManagerInterface *CppModelManagerInterface::instance()
-{
- return qobject_cast<CppModelManagerInterface *>(CPlusPlus::CppModelManagerBase::instance());
-}
diff --git a/src/plugins/cpptools/cppmodelmanagerinterface.h b/src/plugins/cpptools/cppmodelmanagerinterface.h
deleted file mode 100644
index 4217dd3f0c..0000000000
--- a/src/plugins/cpptools/cppmodelmanagerinterface.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#ifndef CPPMODELMANAGERINTERFACE_H
-#define CPPMODELMANAGERINTERFACE_H
-
-#include "cpptools_global.h"
-
-#include "cppprojects.h"
-
-#include <cplusplus/CppDocument.h>
-#include <cplusplus/cppmodelmanagerbase.h>
-
-#include <QFuture>
-#include <QHash>
-#include <QObject>
-#include <QPointer>
-#include <QStringList>
-
-namespace Core { class IEditor; }
-namespace CPlusPlus { class LookupContext; }
-namespace ProjectExplorer { class Project; }
-namespace TextEditor { class BaseTextEditor; class BaseTextDocument; class BlockRange; }
-namespace Utils { class FileName; }
-
-namespace CppTools {
-
-class AbstractEditorSupport;
-class BaseEditorDocumentProcessor;
-class CppCompletionAssistProvider;
-class EditorDocumentHandle;
-class CppIndexingSupport;
-class ModelManagerSupport;
-class WorkingCopy;
-
-class CPPTOOLS_EXPORT CppModelManagerInterface : public CPlusPlus::CppModelManagerBase
-{
- Q_OBJECT
-
-public:
- // Documented in source file.
- enum ProgressNotificationMode {
- ForcedProgressNotification,
- ReservedProgressNotification
- };
-
-public:
- static const QString configurationFileName();
- static const QString editorConfigurationFileName();
-
-public:
- CppModelManagerInterface(QObject *parent = 0);
- virtual ~CppModelManagerInterface();
-
- static CppModelManagerInterface *instance();
-
- virtual bool isCppEditor(Core::IEditor *editor) const = 0;
-
- virtual WorkingCopy workingCopy() const = 0;
- virtual QByteArray codeModelConfiguration() const = 0;
-
- virtual QList<ProjectInfo> projectInfos() const = 0;
- virtual ProjectInfo projectInfo(ProjectExplorer::Project *project) const = 0;
- virtual QFuture<void> updateProjectInfo(const ProjectInfo &pinfo) = 0;
- virtual ProjectPart::Ptr projectPartForProjectFile(const QString &projectFile) const = 0;
- virtual QList<ProjectPart::Ptr> projectPart(const QString &fileName) const = 0;
- virtual QList<ProjectPart::Ptr> projectPartFromDependencies(const QString &fileName) const = 0;
- virtual ProjectPart::Ptr fallbackProjectPart() const = 0;
-
- virtual void addExtraEditorSupport(CppTools::AbstractEditorSupport *editorSupport) = 0;
- virtual void removeExtraEditorSupport(CppTools::AbstractEditorSupport *editorSupport) = 0;
-
- virtual EditorDocumentHandle *editorDocument(const QString &filePath) = 0;
- virtual void registerEditorDocument(EditorDocumentHandle *editorDocument) = 0;
- virtual void unregisterEditorDocument(const QString &filePath) = 0;
-
- virtual QList<int> references(CPlusPlus::Symbol *symbol,
- const CPlusPlus::LookupContext &context) = 0;
-
- virtual void renameUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context,
- const QString &replacement = QString()) = 0;
- virtual void findUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context) = 0;
-
- virtual void renameMacroUsages(const CPlusPlus::Macro &macro, const QString &replacement = QString()) = 0;
- virtual void findMacroUsages(const CPlusPlus::Macro &macro) = 0;
-
- virtual void finishedRefreshingSourceFiles(const QSet<QString> &files) = 0;
-
- virtual void addModelManagerSupport(ModelManagerSupport *modelManagerSupport) = 0;
- virtual ModelManagerSupport *modelManagerSupportForMimeType(const QString &mimeType) const = 0;
- virtual CppCompletionAssistProvider *completionAssistProvider(const QString &mimeType) const = 0;
- virtual BaseEditorDocumentProcessor *editorDocumentProcessor(
- TextEditor::BaseTextDocument *baseTextDocument) const = 0;
-
- virtual void setIndexingSupport(CppTools::CppIndexingSupport *indexingSupport) = 0;
- virtual CppIndexingSupport *indexingSupport() = 0;
-
- virtual void setHeaderPaths(const ProjectPart::HeaderPaths &headerPaths) = 0;
- virtual void enableGarbageCollector(bool enable) = 0;
-
- virtual ProjectPart::HeaderPaths headerPaths() = 0;
- virtual QByteArray definedMacros() = 0;
-
-signals:
- /// Project data might be locked while this is emitted.
- void aboutToRemoveFiles(const QStringList &files);
-
- void documentUpdated(CPlusPlus::Document::Ptr doc);
- void sourceFilesRefreshed(const QSet<QString> &files);
-
- /// \brief Emitted after updateProjectInfo function is called on the model-manager.
- ///
- /// Other classes can use this to get notified when the \c ProjectExplorer has updated the parts.
- void projectPartsUpdated(ProjectExplorer::Project *project);
-
-public slots:
- // Documented in source file.
- virtual QFuture<void> updateSourceFiles(const QSet<QString> &sourceFiles,
- ProgressNotificationMode mode = ReservedProgressNotification) = 0;
-
- virtual void updateModifiedSourceFiles() = 0;
- virtual void GC() = 0;
-};
-
-} // namespace CppTools
-
-#endif // CPPMODELMANAGERINTERFACE_H
diff --git a/src/plugins/cpptools/cpprefactoringchanges.cpp b/src/plugins/cpptools/cpprefactoringchanges.cpp
index 3a1f06465a..057522c776 100644
--- a/src/plugins/cpptools/cpprefactoringchanges.cpp
+++ b/src/plugins/cpptools/cpprefactoringchanges.cpp
@@ -46,7 +46,7 @@ class CppTools::CppRefactoringChangesData : public TextEditor::RefactoringChange
public:
CppRefactoringChangesData(const Snapshot &snapshot)
: m_snapshot(snapshot)
- , m_modelManager(Internal::CppModelManager::instance())
+ , m_modelManager(CppModelManager::instance())
, m_workingCopy(m_modelManager->workingCopy())
{}
@@ -78,7 +78,7 @@ public:
}
Snapshot m_snapshot;
- CppModelManagerInterface *m_modelManager;
+ CppModelManager *m_modelManager;
WorkingCopy m_workingCopy;
};
diff --git a/src/plugins/cpptools/cpprefactoringchanges.h b/src/plugins/cpptools/cpprefactoringchanges.h
index 3fb96ed72b..286988929c 100644
--- a/src/plugins/cpptools/cpprefactoringchanges.h
+++ b/src/plugins/cpptools/cpprefactoringchanges.h
@@ -31,7 +31,7 @@
#define CPPREFACTORINGCHANGES_H
#include "cpptools_global.h"
-#include "cppmodelmanagerinterface.h"
+#include "cppmodelmanager.h"
#include <texteditor/refactoringchanges.h>
diff --git a/src/plugins/cpptools/cppsourceprocessor.h b/src/plugins/cpptools/cppsourceprocessor.h
index e503bd5b16..1843a8894d 100644
--- a/src/plugins/cpptools/cppsourceprocessor.h
+++ b/src/plugins/cpptools/cppsourceprocessor.h
@@ -30,7 +30,7 @@
#ifndef CPPSOURCEPROCESSOR_H
#define CPPSOURCEPROCESSOR_H
-#include "cppmodelmanagerinterface.h"
+#include "cppmodelmanager.h"
#include "cppworkingcopy.h"
#include <cplusplus/PreprocessorEnvironment.h>
diff --git a/src/plugins/cpptools/cpptools.pro b/src/plugins/cpptools/cpptools.pro
index 83322a1dce..4408a94714 100644
--- a/src/plugins/cpptools/cpptools.pro
+++ b/src/plugins/cpptools/cpptools.pro
@@ -33,7 +33,6 @@ HEADERS += \
cpplocatordata.h \
cpplocatorfilter.h \
cppmodelmanager.h \
- cppmodelmanagerinterface.h \
cppmodelmanagersupport.h \
cppmodelmanagersupportinternal.h \
cpppointerdeclarationformatter.h \
@@ -95,7 +94,6 @@ SOURCES += \
cpplocatordata.cpp \
cpplocatorfilter.cpp \
cppmodelmanager.cpp \
- cppmodelmanagerinterface.cpp \
cppmodelmanagersupport.cpp \
cppmodelmanagersupportinternal.cpp \
cpppointerdeclarationformatter.cpp \
diff --git a/src/plugins/cpptools/cpptools.qbs b/src/plugins/cpptools/cpptools.qbs
index 16996bc060..d4656891fd 100644
--- a/src/plugins/cpptools/cpptools.qbs
+++ b/src/plugins/cpptools/cpptools.qbs
@@ -53,7 +53,6 @@ QtcPlugin {
"cpplocatordata.cpp", "cpplocatordata.h",
"cpplocatorfilter.cpp", "cpplocatorfilter.h",
"cppmodelmanager.cpp", "cppmodelmanager.h",
- "cppmodelmanagerinterface.cpp", "cppmodelmanagerinterface.h",
"cppmodelmanagersupport.cpp", "cppmodelmanagersupport.h",
"cppmodelmanagersupportinternal.cpp", "cppmodelmanagersupportinternal.h",
"cpppointerdeclarationformatter.cpp", "cpppointerdeclarationformatter.h",
diff --git a/src/plugins/cpptools/cpptoolsplugin.h b/src/plugins/cpptools/cpptoolsplugin.h
index 27de8d0ba4..b3b883eb44 100644
--- a/src/plugins/cpptools/cpptoolsplugin.h
+++ b/src/plugins/cpptools/cpptoolsplugin.h
@@ -50,7 +50,6 @@ class CppToolsSettings;
namespace Internal {
-class CppModelManager;
struct CppFileSettings;
class CppCodeModelSettings;
diff --git a/src/plugins/cpptools/cpptoolstestcase.cpp b/src/plugins/cpptools/cpptoolstestcase.cpp
index c91451d179..d76ee4818e 100644
--- a/src/plugins/cpptools/cpptoolstestcase.cpp
+++ b/src/plugins/cpptools/cpptoolstestcase.cpp
@@ -39,9 +39,9 @@
static bool closeEditorsWithoutGarbageCollectorInvocation(const QList<Core::IEditor *> &editors)
{
- CppTools::CppModelManagerInterface::instance()->enableGarbageCollector(false);
+ CppTools::CppModelManager::instance()->enableGarbageCollector(false);
const bool closeEditorsSucceeded = Core::EditorManager::closeEditors(editors, false);
- CppTools::CppModelManagerInterface::instance()->enableGarbageCollector(true);
+ CppTools::CppModelManager::instance()->enableGarbageCollector(true);
return closeEditorsSucceeded;
}
@@ -79,7 +79,7 @@ bool TestDocument::writeToDisk() const
}
TestCase::TestCase(bool runGarbageCollector)
- : m_modelManager(CppModelManagerInterface::instance())
+ : m_modelManager(CppModelManager::instance())
, m_succeededSoFar(false)
, m_runGarbageCollector(runGarbageCollector)
{
@@ -116,18 +116,18 @@ bool TestCase::openBaseTextEditor(const QString &fileName, TextEditor::BaseTextE
CPlusPlus::Snapshot TestCase::globalSnapshot()
{
- return CppModelManagerInterface::instance()->snapshot();
+ return CppModelManager::instance()->snapshot();
}
bool TestCase::garbageCollectGlobalSnapshot()
{
- CppModelManagerInterface::instance()->GC();
+ CppModelManager::instance()->GC();
return globalSnapshot().isEmpty();
}
bool TestCase::parseFiles(const QSet<QString> &filePaths)
{
- CppModelManagerInterface::instance()->updateSourceFiles(filePaths).waitForFinished();
+ CppModelManager::instance()->updateSourceFiles(filePaths).waitForFinished();
QCoreApplication::processEvents();
const CPlusPlus::Snapshot snapshot = globalSnapshot();
if (snapshot.isEmpty()) {
diff --git a/src/plugins/cpptools/cpptoolstestcase.h b/src/plugins/cpptools/cpptoolstestcase.h
index c222aa506c..321e957bc4 100644
--- a/src/plugins/cpptools/cpptoolstestcase.h
+++ b/src/plugins/cpptools/cpptoolstestcase.h
@@ -30,7 +30,7 @@
#ifndef CPPTOOLSTESTCASE_H
#define CPPTOOLSTESTCASE_H
-#include "cppmodelmanagerinterface.h"
+#include "cppmodelmanager.h"
#include "cpptools_global.h"
#include <coreplugin/editormanager/ieditor.h>
@@ -88,7 +88,7 @@ public:
static bool writeFile(const QString &filePath, const QByteArray &contents);
protected:
- CppModelManagerInterface *m_modelManager;
+ CppModelManager *m_modelManager;
bool m_succeededSoFar;
private:
diff --git a/src/plugins/cpptools/symbolsfindfilter.h b/src/plugins/cpptools/symbolsfindfilter.h
index 4c5c15b247..6f325b1ba5 100644
--- a/src/plugins/cpptools/symbolsfindfilter.h
+++ b/src/plugins/cpptools/symbolsfindfilter.h
@@ -41,10 +41,11 @@
#include <QRadioButton>
namespace CppTools {
-namespace Internal {
class CppModelManager;
+namespace Internal {
+
class SymbolsFindFilter : public Core::IFindFilter
{
Q_OBJECT
diff --git a/src/plugins/cpptools/typehierarchybuilder.h b/src/plugins/cpptools/typehierarchybuilder.h
index fa40ffeefa..64a0edc93e 100644
--- a/src/plugins/cpptools/typehierarchybuilder.h
+++ b/src/plugins/cpptools/typehierarchybuilder.h
@@ -31,7 +31,7 @@
#define CPPTOOLS_TYPEHIERARCHYBUILDER_H
#include "cpptools_global.h"
-#include "cppmodelmanagerinterface.h"
+#include "cppmodelmanager.h"
#include <cplusplus/Overview.h>
diff --git a/src/plugins/cpptools/typehierarchybuilder_test.cpp b/src/plugins/cpptools/typehierarchybuilder_test.cpp
index 0a933dd8b9..8627b83b18 100644
--- a/src/plugins/cpptools/typehierarchybuilder_test.cpp
+++ b/src/plugins/cpptools/typehierarchybuilder_test.cpp
@@ -29,7 +29,7 @@
#include "cpptoolsplugin.h"
-#include "cppmodelmanagerinterface.h"
+#include "cppmodelmanager.h"
#include "cpptoolstestcase.h"
#include "typehierarchybuilder.h"
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp
index 56f278fb96..1c14b987af 100644
--- a/src/plugins/debugger/cdb/cdbengine.cpp
+++ b/src/plugins/debugger/cdb/cdbengine.cpp
@@ -67,7 +67,7 @@
#include <utils/hostosinfo.h>
#include <cplusplus/findcdbbreakpoint.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cpptools/cppworkingcopy.h>
#include <QDir>
@@ -2914,7 +2914,7 @@ void CdbEngine::attemptBreakpointSynchronization()
&& boolSetting(CdbBreakPointCorrection)) {
if (lineCorrection.isNull())
lineCorrection.reset(new BreakpointCorrectionContext(debuggerCore()->cppCodeModelSnapshot(),
- CppTools::CppModelManagerInterface::instance()->workingCopy()));
+ CppTools::CppModelManager::instance()->workingCopy()));
response.lineNumber = lineCorrection->fixLineNumber(parameters.fileName, parameters.lineNumber);
postBuiltinCommand(
cdbAddBreakpointCommand(response, m_sourcePathMappings, id, false), 0,
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 222cf05018..95ba90f53d 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -82,7 +82,7 @@
#include <coreplugin/modemanager.h>
#include <cppeditor/cppeditorconstants.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <extensionsystem/invoker.h>
@@ -2515,7 +2515,7 @@ void DebuggerPluginPrivate::coreShutdown()
const CPlusPlus::Snapshot &DebuggerPluginPrivate::cppCodeModelSnapshot() const
{
if (m_codeModelSnapshot.isEmpty() && action(UseCodeModel)->isChecked())
- m_codeModelSnapshot = CppTools::CppModelManagerInterface::instance()->snapshot();
+ m_codeModelSnapshot = CppTools::CppModelManager::instance()->snapshot();
return m_codeModelSnapshot;
}
diff --git a/src/plugins/debugger/sourceutils.cpp b/src/plugins/debugger/sourceutils.cpp
index 6b53084191..1fb0b50ea1 100644
--- a/src/plugins/debugger/sourceutils.cpp
+++ b/src/plugins/debugger/sourceutils.cpp
@@ -35,7 +35,7 @@
#include <texteditor/basetexteditor.h>
#include <cpptools/abstracteditorsupport.h>
#include <cpptools/cppprojectfile.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cplusplus/ExpressionUnderCursor.h>
#include <cplusplus/Overview.h>
@@ -337,7 +337,7 @@ QString cppExpressionAt(TextEditor::BaseTextEditor *editor, int pos,
QTextCursor tc = plaintext->textCursor();
QString expr = tc.selectedText();
- CppModelManagerInterface *modelManager = CppModelManagerInterface::instance();
+ CppModelManager *modelManager = CppModelManager::instance();
if (expr.isEmpty() && modelManager) {
QTextDocument *doc = plaintext->document();
QTC_ASSERT(doc, return QString());
@@ -394,7 +394,7 @@ QString cppFunctionAt(const QString &fileName, int line)
{
using namespace CppTools;
using namespace CPlusPlus;
- CppModelManagerInterface *modelManager = CppModelManagerInterface::instance();
+ CppModelManager *modelManager = CppModelManager::instance();
return AbstractEditorSupport::functionAt(modelManager,
fileName, line, 1);
}
diff --git a/src/plugins/designer/codemodelhelpers.cpp b/src/plugins/designer/codemodelhelpers.cpp
index 5834a203fc..8e29788ccb 100644
--- a/src/plugins/designer/codemodelhelpers.cpp
+++ b/src/plugins/designer/codemodelhelpers.cpp
@@ -29,7 +29,7 @@
#include "codemodelhelpers.h"
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/project.h>
@@ -118,7 +118,7 @@ bool navigateToSlot(const QString &uiFileName,
*errorMessage = QCoreApplication::translate("Designer", "The generated header of the form \"%1\" could not be found.\nRebuilding the project might help.").arg(uiFileName);
return false;
}
- const CPlusPlus::Snapshot snapshot = CppTools::CppModelManagerInterface::instance()->snapshot();
+ const CPlusPlus::Snapshot snapshot = CppTools::CppModelManager::instance()->snapshot();
const DocumentPtr generatedHeaderDoc = snapshot.document(generatedHeaderFile);
if (!generatedHeaderDoc) {
*errorMessage = QCoreApplication::translate("Designer", "The generated header \"%1\" could not be found in the code model.\nRebuilding the project might help.").arg(generatedHeaderFile);
diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp
index 3699fff1b1..ff5b6b9773 100644
--- a/src/plugins/designer/qtcreatorintegration.cpp
+++ b/src/plugins/designer/qtcreatorintegration.cpp
@@ -34,7 +34,7 @@
#include <widgethost.h>
#include <designer/cpp/formclasswizardpage.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cpptools/cpptoolsconstants.h>
#include <cpptools/cppworkingcopy.h>
#include <cpptools/insertionpointlocator.h>
@@ -248,7 +248,7 @@ static Function *findDeclaration(const Class *cl, const QString &functionName)
// TODO: remove me, this is taken from cppeditor.cpp. Find some common place for this function
static Document::Ptr findDefinition(Function *functionDeclaration, int *line)
{
- if (CppTools::CppModelManagerInterface *cppModelManager = CppTools::CppModelManagerInterface::instance()) {
+ if (CppTools::CppModelManager *cppModelManager = CppTools::CppModelManager::instance()) {
const Snapshot snapshot = cppModelManager->snapshot();
CppTools::SymbolFinder symbolFinder;
if (Function *fun = symbolFinder.findMatchingDefinition(functionDeclaration, snapshot)) {
@@ -523,7 +523,7 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
const QString uicedName = QLatin1String("ui_") + fi.completeBaseName() + QLatin1String(".h");
// Retrieve code model snapshot restricted to project of ui file or the working copy.
- Snapshot docTable = CppTools::CppModelManagerInterface::instance()->snapshot();
+ Snapshot docTable = CppTools::CppModelManager::instance()->snapshot();
Snapshot newDocTable;
const Project *uiProject = SessionManager::projectForFile(currentUiFile);
if (uiProject) {
@@ -535,12 +535,12 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
}
} else {
const CppTools::WorkingCopy workingCopy =
- CppTools::CppModelManagerInterface::instance()->workingCopy();
+ CppTools::CppModelManager::instance()->workingCopy();
QHashIterator<QString, QPair<QByteArray, unsigned> > it = workingCopy.iterator();
while (it.hasNext()) {
it.next();
const QString fileName = it.key();
- if (fileName != CppTools::CppModelManagerInterface::configurationFileName())
+ if (fileName != CppTools::CppModelManager::configurationFileName())
newDocTable.insert(docTable.document(fileName));
}
}
@@ -613,7 +613,7 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
} else {
// add function declaration to cl
CppTools::WorkingCopy workingCopy =
- CppTools::CppModelManagerInterface::instance()->workingCopy();
+ CppTools::CppModelManager::instance()->workingCopy();
const QString fileName = doc->fileName();
getParsedDocument(fileName, workingCopy, docTable);
addDeclaration(docTable, fileName, cl, functionNameWithParameterNames);
diff --git a/src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp b/src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
index aad699a56b..07e146f464 100644
--- a/src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
+++ b/src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
@@ -44,9 +44,9 @@ CppModelManagerHelper::CppModelManagerHelper(QObject *parent)
this, SLOT(onSourceFilesRefreshed(const QSet<QString> &)));
}
-CppModelManagerInterface *CppModelManagerHelper::cppModelManager()
+CppModelManager *CppModelManagerHelper::cppModelManager()
{
- return CppModelManagerInterface::instance();
+ return CppModelManager::instance();
}
void CppModelManagerHelper::waitForSourceFilesRefreshed(const QString &file, int timeOut)
diff --git a/src/plugins/genericprojectmanager/cppmodelmanagerhelper.h b/src/plugins/genericprojectmanager/cppmodelmanagerhelper.h
index 30b98929be..18e7c1d85e 100644
--- a/src/plugins/genericprojectmanager/cppmodelmanagerhelper.h
+++ b/src/plugins/genericprojectmanager/cppmodelmanagerhelper.h
@@ -30,7 +30,7 @@
#ifndef CPPMODELMANAGERHELPER_H
#define CPPMODELMANAGERHELPER_H
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <QObject>
#include <QSignalSpy>
@@ -45,7 +45,7 @@ class CppModelManagerHelper : public QObject
public:
explicit CppModelManagerHelper(QObject *parent = 0);
- static CppTools::CppModelManagerInterface *cppModelManager();
+ static CppTools::CppModelManager *cppModelManager();
enum { defaultTimeOut = 30 * 1000 }; // 30 secs
void waitForSourceFilesRefreshed(const QString &file = QString(), int timeOut = defaultTimeOut);
diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp
index 51dcdbd236..bcdbc7aa25 100644
--- a/src/plugins/genericprojectmanager/genericproject.cpp
+++ b/src/plugins/genericprojectmanager/genericproject.cpp
@@ -38,7 +38,7 @@
#include <coreplugin/icore.h>
#include <coreplugin/mimedatabase.h>
#include <cpptools/cpptoolsconstants.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/abi.h>
#include <projectexplorer/buildsteplist.h>
@@ -326,8 +326,8 @@ QStringList GenericProject::processEntries(const QStringList &paths,
void GenericProject::refreshCppCodeModel()
{
- CppTools::CppModelManagerInterface *modelManager =
- CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *modelManager =
+ CppTools::CppModelManager::instance();
if (!modelManager)
return;
diff --git a/src/plugins/genericprojectmanager/genericprojectplugin_test.cpp b/src/plugins/genericprojectmanager/genericprojectplugin_test.cpp
index ec1770887a..127ab1c0c9 100644
--- a/src/plugins/genericprojectmanager/genericprojectplugin_test.cpp
+++ b/src/plugins/genericprojectmanager/genericprojectplugin_test.cpp
@@ -98,7 +98,7 @@ static ProjectInfo setupProject(const QByteArray &projectFile, const QByteArray
// retrieve them for inspection.
cppHelper.waitForSourceFilesRefreshed(projectFilePath(_(mainFile)));
- CppModelManagerInterface *mm = cppHelper.cppModelManager();
+ CppModelManager *mm = cppHelper.cppModelManager();
return mm->projectInfo(project);
}
diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp
index ff7cadbe45..a1bcf2f1c1 100644
--- a/src/plugins/qbsprojectmanager/qbsproject.cpp
+++ b/src/plugins/qbsprojectmanager/qbsproject.cpp
@@ -45,7 +45,7 @@
#include <coreplugin/messagemanager.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/mimedatabase.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <projectexplorer/buildenvironmentwidget.h>
#include <projectexplorer/buildmanager.h>
#include <projectexplorer/buildtargetinfo.h>
@@ -648,8 +648,8 @@ void QbsProject::updateCppCodeModel(const qbs::ProjectData &prj)
QtSupport::BaseQtVersion *qtVersion =
QtSupport::QtKitInformation::qtVersion(activeTarget()->kit());
- CppTools::CppModelManagerInterface *modelmanager =
- CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *modelmanager =
+ CppTools::CppModelManager::instance();
if (!modelmanager)
return;
diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp
index ea85bf269f..1daf1eeddb 100644
--- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp
@@ -53,7 +53,7 @@
#include <resourceeditor/resourcenode.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <cpptools/cpptoolsconstants.h>
#include <utils/algorithm.h>
diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp
index 639f86706e..49d1bba941 100644
--- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp
@@ -45,7 +45,7 @@
#include <coreplugin/icore.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/documentmanager.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <qmljs/qmljsmodelmanagerinterface.h>
#include <projectexplorer/buildmanager.h>
#include <projectexplorer/buildtargetinfo.h>
@@ -458,9 +458,9 @@ bool QmakeProject::equalFileList(const QStringList &a, const QStringList &b)
QStringList::const_iterator bend = b.constEnd();
while (ait != aend && bit != bend) {
- if (*ait == CppTools::CppModelManagerInterface::configurationFileName())
+ if (*ait == CppTools::CppModelManager::configurationFileName())
++ait;
- else if (*bit == CppTools::CppModelManagerInterface::configurationFileName())
+ else if (*bit == CppTools::CppModelManager::configurationFileName())
++bit;
else if (*ait == *bit)
++ait, ++bit;
@@ -495,8 +495,8 @@ void QmakeProject::updateCppCodeModel()
k = KitManager::defaultKit();
qtVersion = QtSupport::QtKitInformation::qtVersion(k);
- CppTools::CppModelManagerInterface *modelmanager =
- CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *modelmanager =
+ CppTools::CppModelManager::instance();
if (!modelmanager)
return;
@@ -575,7 +575,7 @@ void QmakeProject::updateCppCodeModel()
}
uiCodeModelData.unite(uiData);
- cppPart->files.prepend(ProjectFile(CppTools::CppModelManagerInterface::configurationFileName(),
+ cppPart->files.prepend(ProjectFile(CppTools::CppModelManager::configurationFileName(),
ProjectFile::CXXSource));
const QStringList cxxflags = pro->variableValue(CppFlagsVar);
cppPart->evaluateToolchain(ToolChainKitInformation::toolChain(k),
diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp
index c4d21bef97..886d1f0685 100644
--- a/src/plugins/qmljstools/qmljsmodelmanager.cpp
+++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp
@@ -35,7 +35,7 @@
#include <coreplugin/icore.h>
#include <coreplugin/messagemanager.h>
#include <coreplugin/progressmanager/progressmanager.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/project.h>
@@ -209,8 +209,8 @@ ModelManager::~ModelManager()
void ModelManager::delayedInitialization()
{
- CppTools::CppModelManagerInterface *cppModelManager =
- CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *cppModelManager =
+ CppTools::CppModelManager::instance();
if (cppModelManager) {
// It's important to have a direct connection here so we can prevent
// the source and AST of the cpp document being cleaned away.
diff --git a/src/plugins/qmljstools/qmljsmodelmanager.h b/src/plugins/qmljstools/qmljsmodelmanager.h
index ca0b2504a1..64a41ee042 100644
--- a/src/plugins/qmljstools/qmljsmodelmanager.h
+++ b/src/plugins/qmljstools/qmljsmodelmanager.h
@@ -48,16 +48,9 @@ QT_FORWARD_DECLARE_CLASS(QLocale)
namespace Core { class MimeType; }
-namespace CPlusPlus { class CppModelManagerInterface; }
-
-namespace QmlJS { class QrcParser; }
-
namespace QmlJSTools {
-
namespace Internal {
-class PluginDumper;
-
class QMLJSTOOLS_EXPORT ModelManager: public QmlJS::ModelManagerInterface
{
Q_OBJECT
diff --git a/src/plugins/qtsupport/uicodemodelsupport.cpp b/src/plugins/qtsupport/uicodemodelsupport.cpp
index 4c297a5f28..3128280d86 100644
--- a/src/plugins/qtsupport/uicodemodelsupport.cpp
+++ b/src/plugins/qtsupport/uicodemodelsupport.cpp
@@ -33,7 +33,7 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/buildmanager.h>
#include <projectexplorer/project.h>
@@ -67,7 +67,7 @@ static inline QString formWindowEditorContents(const QObject *editor)
namespace QtSupport {
-UiCodeModelSupport::UiCodeModelSupport(CppTools::CppModelManagerInterface *modelmanager,
+UiCodeModelSupport::UiCodeModelSupport(CppTools::CppModelManager *modelmanager,
ProjectExplorer::Project *project,
const QString &uiFile,
const QString &uiHeaderFile)
@@ -339,7 +339,7 @@ static UiCodeModelSupport *findUiFile(const QList<UiCodeModelSupport *> &range,
void UiCodeModelManager::update(ProjectExplorer::Project *project, QHash<QString, QString> uiHeaders)
{
- CppTools::CppModelManagerInterface *mm = CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *mm = CppTools::CppModelManager::instance();
// Find support to add/update:
QList<UiCodeModelSupport *> oldSupport = m_instance->m_projectUiSupport.value(project);
@@ -391,7 +391,7 @@ void UiCodeModelManager::buildStateHasChanged(Project *project)
void UiCodeModelManager::projectWasRemoved(Project *project)
{
- CppTools::CppModelManagerInterface *mm = CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *mm = CppTools::CppModelManager::instance();
QList<UiCodeModelSupport *> projectSupport = m_projectUiSupport.value(project);
foreach (UiCodeModelSupport *const i, projectSupport) {
diff --git a/src/plugins/qtsupport/uicodemodelsupport.h b/src/plugins/qtsupport/uicodemodelsupport.h
index f71030a8f2..fa57e046c7 100644
--- a/src/plugins/qtsupport/uicodemodelsupport.h
+++ b/src/plugins/qtsupport/uicodemodelsupport.h
@@ -40,7 +40,7 @@
#include <QSet>
namespace Core { class IEditor; }
-namespace CPlusPlus { class CppModelManagerInterface; }
+namespace CPlusPlus { class CppModelManager; }
namespace ProjectExplorer { class Project; }
namespace QtSupport {
@@ -52,7 +52,7 @@ class UiCodeModelSupport : public CppTools::AbstractEditorSupport
Q_OBJECT
public:
- UiCodeModelSupport(CppTools::CppModelManagerInterface *modelmanager,
+ UiCodeModelSupport(CppTools::CppModelManager *modelmanager,
ProjectExplorer::Project *project,
const QString &sourceFile,
const QString &uiHeaderFile);
diff --git a/src/plugins/texteditor/codeassist/keywordscompletionassist.cpp b/src/plugins/texteditor/codeassist/keywordscompletionassist.cpp
index a209a94ab4..2b30651b22 100644
--- a/src/plugins/texteditor/codeassist/keywordscompletionassist.cpp
+++ b/src/plugins/texteditor/codeassist/keywordscompletionassist.cpp
@@ -82,8 +82,8 @@ QStringList Keywords::argsForFunction(const QString &function) const
// --------------------------
// KeywordsAssistProposalItem
// --------------------------
-KeywordsAssistProposalItem::KeywordsAssistProposalItem(Keywords keywords)
- : m_keywords(keywords)
+KeywordsAssistProposalItem::KeywordsAssistProposalItem(bool isFunction)
+ : m_isFunction(isFunction)
{
}
@@ -93,9 +93,7 @@ KeywordsAssistProposalItem::~KeywordsAssistProposalItem()
bool KeywordsAssistProposalItem::prematurelyApplies(const QChar &c) const
{
// only '(' in case of a function
- if (c == QLatin1Char('(') && m_keywords.isFunction(text()))
- return true;
- return false;
+ return c == QLatin1Char('(') && m_isFunction;
}
void KeywordsAssistProposalItem::applyContextualContent(BaseTextEditorWidget *editorWidget,
@@ -106,7 +104,7 @@ void KeywordsAssistProposalItem::applyContextualContent(BaseTextEditorWidget *ed
int replaceLength = editorWidget->position() - basePosition;
QString toInsert = text();
int cursorOffset = 0;
- if (m_keywords.isFunction(toInsert) && settings.m_autoInsertBrackets) {
+ if (m_isFunction && settings.m_autoInsertBrackets) {
if (settings.m_spaceAfterFunctionName) {
if (editorWidget->textAt(editorWidget->position(), 2) == QLatin1String(" (")) {
cursorOffset = 2;
@@ -263,7 +261,7 @@ void KeywordsCompletionAssistProcessor::addWordsToProposalList(QList<AssistPropo
return;
for (int i = 0; i < words.count(); ++i) {
- AssistProposalItem *item = new KeywordsAssistProposalItem(m_keywords);
+ AssistProposalItem *item = new KeywordsAssistProposalItem(m_keywords.isFunction(words.at(i)));
item->setText(words.at(i));
item->setIcon(icon);
items->append(item);
diff --git a/src/plugins/texteditor/codeassist/keywordscompletionassist.h b/src/plugins/texteditor/codeassist/keywordscompletionassist.h
index 7a68c16fc8..6803d02c2a 100644
--- a/src/plugins/texteditor/codeassist/keywordscompletionassist.h
+++ b/src/plugins/texteditor/codeassist/keywordscompletionassist.h
@@ -59,13 +59,13 @@ private:
class TEXTEDITOR_EXPORT KeywordsAssistProposalItem : public AssistProposalItem
{
public:
- KeywordsAssistProposalItem(Keywords keywords);
+ KeywordsAssistProposalItem(bool isFunction);
~KeywordsAssistProposalItem();
bool prematurelyApplies(const QChar &c) const QTC_OVERRIDE;
void applyContextualContent(BaseTextEditorWidget *editorWidget, int basePosition) const QTC_OVERRIDE;
private:
- Keywords m_keywords;
+ bool m_isFunction;
};
class TEXTEDITOR_EXPORT KeywordsFunctionHintModel : public IFunctionHintProposalModel
diff --git a/src/plugins/todo/cpptodoitemsscanner.cpp b/src/plugins/todo/cpptodoitemsscanner.cpp
index c606222518..0a949170d5 100644
--- a/src/plugins/todo/cpptodoitemsscanner.cpp
+++ b/src/plugins/todo/cpptodoitemsscanner.cpp
@@ -41,7 +41,7 @@ namespace Internal {
CppTodoItemsScanner::CppTodoItemsScanner(const KeywordList &keywordList, QObject *parent) :
TodoItemsScanner(keywordList, parent)
{
- CppTools::CppModelManagerInterface *modelManager = CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance();
connect(modelManager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)), this,
SLOT(documentUpdated(CPlusPlus::Document::Ptr)), Qt::DirectConnection);
@@ -52,7 +52,7 @@ void CppTodoItemsScanner::keywordListChanged()
// We need to rescan everything known to the code model
// TODO: It would be nice to only tokenize the source files, not update the code model entirely.
- CppTools::CppModelManagerInterface *modelManager = CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance();
QSet<QString> filesToBeUpdated;
foreach (const CppTools::ProjectInfo &info, modelManager->projectInfos())
@@ -63,7 +63,7 @@ void CppTodoItemsScanner::keywordListChanged()
void CppTodoItemsScanner::documentUpdated(CPlusPlus::Document::Ptr doc)
{
- CppTools::CppModelManagerInterface *modelManager = CppTools::CppModelManagerInterface::instance();
+ CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance();
if (!modelManager->projectPart(doc->fileName()).isEmpty())
processDocument(doc);
}
diff --git a/src/plugins/todo/cpptodoitemsscanner.h b/src/plugins/todo/cpptodoitemsscanner.h
index 78a7d9158d..d542af3038 100644
--- a/src/plugins/todo/cpptodoitemsscanner.h
+++ b/src/plugins/todo/cpptodoitemsscanner.h
@@ -33,7 +33,7 @@
#include "todoitemsscanner.h"
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
namespace Todo {
namespace Internal {
diff --git a/src/plugins/todo/todoitemsprovider.cpp b/src/plugins/todo/todoitemsprovider.cpp
index e2d260b8a1..4c97291d58 100644
--- a/src/plugins/todo/todoitemsprovider.cpp
+++ b/src/plugins/todo/todoitemsprovider.cpp
@@ -94,7 +94,7 @@ void TodoItemsProvider::createScanners()
{
qRegisterMetaType<QList<TodoItem> >("QList<TodoItem>");
- if (CppTools::CppModelManagerInterface::instance())
+ if (CppTools::CppModelManager::instance())
m_scanners << new CppTodoItemsScanner(m_settings.keywords, this);
if (QmlJS::ModelManagerInterface::instance())
diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
index 8c08d58121..ee8f49497c 100644
--- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
+++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
@@ -39,7 +39,7 @@
#include "vcsplugin.h"
#include <aggregation/aggregate.h>
-#include <cpptools/cppmodelmanagerinterface.h>
+#include <cpptools/cppmodelmanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
#include <utils/checkablemessagebox.h>
@@ -438,7 +438,7 @@ void VcsBaseSubmitEditor::setFileModel(SubmitFileModel *model, const QString &re
d->m_widget->setFileModel(model);
QSet<QString> uniqueSymbols;
- const CPlusPlus::Snapshot cppSnapShot = CppTools::CppModelManagerInterface::instance()->snapshot();
+ const CPlusPlus::Snapshot cppSnapShot = CppTools::CppModelManager::instance()->snapshot();
// Iterate over the files and get interesting symbols
for (int row = 0; row < model->rowCount(); ++row) {