Commit b26a17f3 authored by hjk's avatar hjk Committed by Nikolai Kosjar

CppTools: Change CppModelManager implementation pattern

Replace the CppModelManagerInterface/derived CppModelManager
combo by a more common CppModelManager/CppModelManagerPrivate
pimpl pattern.

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