Commit 5f50a6ae authored by Christian Kamm's avatar Christian Kamm

C++: Move the ModelManagerInterface from CppTools to CPlusPlus.

parent 5de7be5f
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include "ModelManagerInterface.h"
using namespace CPlusPlus;
static CppModelManagerInterface *g_instance = 0;
CppModelManagerInterface::CppModelManagerInterface(QObject *parent)
: QObject(parent)
{
Q_ASSERT(! g_instance);
g_instance = this;
}
CppModelManagerInterface::~CppModelManagerInterface()
{
Q_ASSERT(g_instance == this);
g_instance = 0;
}
CppModelManagerInterface *CppModelManagerInterface::instance()
{
return g_instance;
}
......@@ -34,7 +34,6 @@
#ifndef CPPMODELMANAGERINTERFACE_H
#define CPPMODELMANAGERINTERFACE_H
#include <cpptools/cpptools_global.h>
#include <cplusplus/CppDocument.h>
#include <QtCore/QObject>
#include <QtCore/QHash>
......@@ -59,14 +58,12 @@ namespace TextEditor {
}
namespace CppTools {
class AbstractEditorSupport;
namespace Internal {
class CppEditorSupport;
class AbstractEditorSupport;
}
class CPPTOOLS_EXPORT CppModelManagerInterface : public QObject
namespace CPlusPlus {
class CPLUSPLUS_EXPORT CppModelManagerInterface : public QObject
{
Q_OBJECT
......@@ -121,8 +118,8 @@ public:
};
public:
CppModelManagerInterface(QObject *parent = 0) : QObject(parent) {}
virtual ~CppModelManagerInterface() {}
CppModelManagerInterface(QObject *parent = 0);
virtual ~CppModelManagerInterface();
static CppModelManagerInterface *instance();
......@@ -137,8 +134,8 @@ public:
virtual QStringList includesInPath(const QString &path) const = 0;
virtual void addEditorSupport(AbstractEditorSupport *editorSupport) = 0;
virtual void removeEditorSupport(AbstractEditorSupport *editorSupport) = 0;
virtual void addEditorSupport(CppTools::AbstractEditorSupport *editorSupport) = 0;
virtual void removeEditorSupport(CppTools::AbstractEditorSupport *editorSupport) = 0;
virtual QList<int> references(CPlusPlus::Symbol *symbol,
const CPlusPlus::LookupContext &context) = 0;
......@@ -153,33 +150,11 @@ Q_SIGNALS:
void documentUpdated(CPlusPlus::Document::Ptr doc);
public Q_SLOTS:
void updateModifiedSourceFiles();
virtual void updateModifiedSourceFiles() = 0;
virtual QFuture<void> updateSourceFiles(const QStringList &sourceFiles) = 0;
virtual void GC() = 0;
};
class CPPTOOLS_EXPORT AbstractEditorSupport
{
public:
explicit AbstractEditorSupport(CppModelManagerInterface *modelmanager);
virtual ~AbstractEditorSupport();
virtual QByteArray contents() const = 0;
virtual QString fileName() const = 0;
void updateDocument();
// TODO: find a better place for common utility functions
static QString functionAt(const CppModelManagerInterface *mm,
const QString &fileName,
int line, int column);
static QString licenseTemplate(const QString &file = QString(), const QString &className = QString());
private:
CppModelManagerInterface *m_modelmanager;
};
} // namespace CppTools
} // namespace CPlusPlus
#endif // CPPMODELMANAGERINTERFACE_H
......@@ -50,7 +50,8 @@ HEADERS += \
$$PWD/pp-cctype.h \
$$PWD/pp-engine.h \
$$PWD/pp-macro-expander.h \
$$PWD/pp-scanner.h
$$PWD/pp-scanner.h \
$$PWD/ModelManagerInterface.h
SOURCES += \
$$PWD/SimpleLexer.cpp \
......@@ -76,6 +77,7 @@ SOURCES += \
$$PWD/Macro.cpp \
$$PWD/pp-engine.cpp \
$$PWD/pp-macro-expander.cpp \
$$PWD/pp-scanner.cpp
$$PWD/pp-scanner.cpp \
$$PWD/ModelManagerInterface.cpp
RESOURCES += $$PWD/cplusplus.qrc
......@@ -41,7 +41,7 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <texteditor/basetexteditor.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <cplusplus/ModelManagerInterface.h>
#include <cpptools/cpptoolsconstants.h>
#include <coreplugin/icore.h>
#include <coreplugin/progressmanager/progressmanager.h>
......@@ -86,7 +86,7 @@ struct ManagerPrivate
QThread parserThread;
//! cpp code model manager
QPointer<CppTools::CppModelManagerInterface> codeModelManager;
QPointer<CPlusPlus::CppModelManagerInterface> codeModelManager;
//! there is some massive operation ongoing so temporary we should wait
bool disableCodeParser;
......@@ -167,7 +167,7 @@ void Manager::initialize()
SLOT(onAllTasksFinished(QString)), Qt::QueuedConnection);
// connect to the cpp model manager for signals about document updates
d_ptr->codeModelManager = CppTools::CppModelManagerInterface::instance();
d_ptr->codeModelManager = CPlusPlus::CppModelManagerInterface::instance();
// when code manager signals that document is updated - handle it by ourselves
connect(d_ptr->codeModelManager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)),
......
......@@ -42,9 +42,9 @@
#include <Name.h>
// other
#include <cplusplus/ModelManagerInterface.h>
#include <cplusplus/Overview.h>
#include <cplusplus/Icons.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <projectexplorer/project.h>
......@@ -570,7 +570,7 @@ void Parser::resetData(const CPlusPlus::Snapshot &snapshot)
void Parser::resetDataToCurrentState()
{
// get latest data
CppTools::CppModelManagerInterface *codeModel = CppTools::CppModelManagerInterface::instance();
CPlusPlus::CppModelManagerInterface *codeModel = CPlusPlus::CppModelManagerInterface::instance();
if (codeModel)
resetData(codeModel->snapshot());
}
......
......@@ -44,8 +44,8 @@
#include <QtCore/QSharedPointer>
#include <CPlusPlusForwardDeclarations.h>
#include <cplusplus/ModelManagerInterface.h>
#include <cplusplus/CppDocument.h>
#include <cpptools/cppmodelmanagerinterface.h>
// might be changed to forward declaration - is not done to be less dependent
#include <projectexplorer/projectnodes.h>
......
......@@ -47,7 +47,7 @@
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/buildmanager.h>
#include <projectexplorer/toolchain.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <cplusplus/ModelManagerInterface.h>
#include <extensionsystem/pluginmanager.h>
#include <designer/formwindoweditor.h>
#include <utils/qtcassert.h>
......@@ -95,8 +95,8 @@ CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName)
CMakeProject::~CMakeProject()
{
// Remove CodeModel support
CppTools::CppModelManagerInterface *modelManager
= ExtensionSystem::PluginManager::instance()->getObject<CppTools::CppModelManagerInterface>();
CPlusPlus::CppModelManagerInterface *modelManager
= ExtensionSystem::PluginManager::instance()->getObject<CPlusPlus::CppModelManagerInterface>();
QMap<QString, CMakeUiCodeModelSupport *>::const_iterator it, end;
it = m_uiCodeModelSupport.constBegin();
end = m_uiCodeModelSupport.constEnd();
......@@ -282,10 +282,10 @@ bool CMakeProject::parseCMakeLists()
allIncludePaths.append(projectDirectory());
allIncludePaths.append(cbpparser.includeFiles());
CppTools::CppModelManagerInterface *modelmanager =
ExtensionSystem::PluginManager::instance()->getObject<CppTools::CppModelManagerInterface>();
CPlusPlus::CppModelManagerInterface *modelmanager =
ExtensionSystem::PluginManager::instance()->getObject<CPlusPlus::CppModelManagerInterface>();
if (modelmanager) {
CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelmanager->projectInfo(this);
CPlusPlus::CppModelManagerInterface::ProjectInfo pinfo = modelmanager->projectInfo(this);
if (pinfo.includePaths != allIncludePaths
|| pinfo.sourceFiles != m_files
|| pinfo.defines != activeBC->toolChain()->predefinedMacros()
......@@ -608,8 +608,8 @@ QString CMakeProject::uiHeaderFile(const QString &uiFile)
void CMakeProject::createUiCodeModelSupport()
{
// qDebug()<<"creatUiCodeModelSupport()";
CppTools::CppModelManagerInterface *modelManager
= ExtensionSystem::PluginManager::instance()->getObject<CppTools::CppModelManagerInterface>();
CPlusPlus::CppModelManagerInterface *modelManager
= ExtensionSystem::PluginManager::instance()->getObject<CPlusPlus::CppModelManagerInterface>();
// First move all to
QMap<QString, CMakeUiCodeModelSupport *> oldCodeModelSupport;
......
......@@ -36,12 +36,14 @@
#include "cmaketarget.h"
#include "cmakebuildconfiguration.h"
#include <cplusplus/ModelManagerInterface.h>
#include <QtCore/QProcess>
using namespace CMakeProjectManager;
using namespace Internal;
CMakeUiCodeModelSupport::CMakeUiCodeModelSupport(CppTools::CppModelManagerInterface *modelmanager,
CMakeUiCodeModelSupport::CMakeUiCodeModelSupport(CPlusPlus::CppModelManagerInterface *modelmanager,
CMakeProject *project,
const QString &source,
const QString &uiHeaderFile)
......
......@@ -34,7 +34,7 @@
#ifndef CMAKEUICODEMODELSUPPORT_H
#define CMAKEUICODEMODELSUPPORT_H
#include <cpptools/cppmodelmanagerinterface.h>
#include <cplusplus/ModelManagerInterface.h>
#include <cpptools/uicodecompletionsupport.h>
#include <QtCore/QDateTime>
......@@ -47,7 +47,7 @@ class CMakeProject;
class CMakeUiCodeModelSupport : public CppTools::UiCodeModelSupport
{
public:
CMakeUiCodeModelSupport(CppTools::CppModelManagerInterface *modelmanager,
CMakeUiCodeModelSupport(CPlusPlus::CppModelManagerInterface *modelmanager,
CMakeProject *project,
const QString &sourceFile,
const QString &uiHeaderFile);
......
......@@ -35,7 +35,7 @@
#include "cppeditorconstants.h"
#include <cpptools/cpptoolsconstants.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <cpptools/abstracteditorsupport.h>
#include <coreplugin/icore.h>
#include <coreplugin/mimedatabase.h>
......
......@@ -54,6 +54,7 @@
#include <SymbolVisitor.h>
#include <TranslationUnit.h>
#include <cplusplus/ASTPath.h>
#include <cplusplus/ModelManagerInterface.h>
#include <cplusplus/ExpressionUnderCursor.h>
#include <cplusplus/TypeOfExpression.h>
#include <cplusplus/Overview.h>
......@@ -64,7 +65,6 @@
#include <cplusplus/FastPreprocessor.h>
#include <cpptools/cpptoolsplugin.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <cpptools/cpptoolsconstants.h>
#include <cpptools/cppcodeformatter.h>
......@@ -426,7 +426,7 @@ CPPEditor::CPPEditor(QWidget *parent)
baseTextDocument()->setSyntaxHighlighter(new CppHighlighter);
m_modelManager = CppTools::CppModelManagerInterface::instance();
m_modelManager = CppModelManagerInterface::instance();
if (m_modelManager) {
connect(m_modelManager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)),
......@@ -558,7 +558,7 @@ void CPPEditor::cut()
finishRename();
}
CppTools::CppModelManagerInterface *CPPEditor::modelManager() const
CppModelManagerInterface *CPPEditor::modelManager() const
{
return m_modelManager;
}
......@@ -666,7 +666,7 @@ const Macro *CPPEditor::findCanonicalMacro(const QTextCursor &cursor, Document::
void CPPEditor::findUsages()
{
SemanticInfo info = m_lastSemanticInfo;
info.snapshot = CppTools::CppModelManagerInterface::instance()->snapshot();
info.snapshot = CppModelManagerInterface::instance()->snapshot();
info.snapshot.insert(info.doc);
CanonicalSymbol cs(this, info);
......@@ -682,7 +682,7 @@ void CPPEditor::findUsages()
void CPPEditor::renameUsagesNow(const QString &replacement)
{
SemanticInfo info = m_lastSemanticInfo;
info.snapshot = CppTools::CppModelManagerInterface::instance()->snapshot();
info.snapshot = CppModelManagerInterface::instance()->snapshot();
info.snapshot.insert(info.doc);
CanonicalSymbol cs(this, info);
......@@ -778,7 +778,7 @@ static QList<int> lazyFindReferences(Scope *scope, QString code, Document::Ptr d
snapshot.insert(doc);
typeOfExpression.init(doc, snapshot);
if (Symbol *canonicalSymbol = CanonicalSymbol::canonicalSymbol(scope, code, typeOfExpression)) {
return CppTools::CppModelManagerInterface::instance()->references(canonicalSymbol, typeOfExpression.context());
return CppModelManagerInterface::instance()->references(canonicalSymbol, typeOfExpression.context());
}
return QList<int>();
}
......
......@@ -38,6 +38,7 @@
#include "cppquickfix.h"
#include "cppsemanticinfo.h"
#include <cplusplus/ModelManagerInterface.h>
#include <cplusplus/CppDocument.h>
#include <cplusplus/LookupContext.h>
#include <texteditor/basetexteditor.h>
......@@ -178,7 +179,7 @@ public:
virtual void paste(); // reimplemented from BaseTextEditor
virtual void cut(); // reimplemented from BaseTextEditor
CppTools::CppModelManagerInterface *modelManager() const;
CPlusPlus::CppModelManagerInterface *modelManager() const;
virtual void setMimeType(const QString &mt);
......@@ -273,7 +274,7 @@ private:
QModelIndex indexForPosition(int line, int column, const QModelIndex &rootIndex = QModelIndex()) const;
CppTools::CppModelManagerInterface *m_modelManager;
CPlusPlus::CppModelManagerInterface *m_modelManager;
QComboBox *m_outlineCombo;
CPlusPlus::OverviewModel *m_outlineModel;
......
......@@ -34,7 +34,6 @@
#include "cppelementevaluator.h"
#include <coreplugin/ifile.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <FullySpecifiedType.h>
#include <Names.h>
......@@ -42,6 +41,7 @@
#include <Scope.h>
#include <Symbol.h>
#include <Symbols.h>
#include <cplusplus/ModelManagerInterface.h>
#include <cplusplus/ExpressionUnderCursor.h>
#include <cplusplus/Overview.h>
#include <cplusplus/TypeOfExpression.h>
......@@ -86,7 +86,7 @@ namespace {
CppElementEvaluator::CppElementEvaluator(CPPEditor *editor) :
m_editor(editor),
m_modelManager(CppTools::CppModelManagerInterface::instance()),
m_modelManager(CppModelManagerInterface::instance()),
m_tc(editor->textCursor()),
m_lookupBaseClasses(false)
{}
......
......@@ -82,7 +82,7 @@ private:
const CPlusPlus::LookupContext &lookupContext);
CPPEditor *m_editor;
CppTools::CppModelManagerInterface *m_modelManager;
CPlusPlus::CppModelManagerInterface *m_modelManager;
QTextCursor m_tc;
bool m_lookupBaseClasses;
QSharedPointer<CppElement> m_element;
......
......@@ -35,7 +35,7 @@
#include "cppeditor.h"
#include "cppeditorconstants.h"
#include <cpptools/cppmodelmanagerinterface.h>
#include <cpptools/abstracteditorsupport.h>
#include <utils/codegeneration.h>
#include <QtCore/QTextStream>
......
......@@ -38,7 +38,7 @@
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/helpmanager.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <cplusplus/ModelManagerInterface.h>
#include <extensionsystem/pluginmanager.h>
#include <texteditor/itexteditor.h>
#include <texteditor/basetexteditor.h>
......
......@@ -62,8 +62,8 @@
#include <texteditor/texteditorplugin.h>
#include <texteditor/texteditorsettings.h>
#include <texteditor/texteditorconstants.h>
#include <cplusplus/ModelManagerInterface.h>
#include <cpptools/cpptoolsconstants.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <QtCore/QFileInfo>
#include <QtCore/QSettings>
......@@ -307,7 +307,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
cppToolsMenu->addAction(createSeparator(am, this, globalContext, CppEditor::Constants::SEPARATOR4));
m_updateCodeModelAction = new QAction(tr("Update Code Model"), this);
cmd = am->registerAction(m_updateCodeModelAction, Core::Id(Constants::UPDATE_CODEMODEL), globalContext);
CppTools::CppModelManagerInterface *cppModelManager = CppTools::CppModelManagerInterface::instance();
CPlusPlus::CppModelManagerInterface *cppModelManager = CPlusPlus::CppModelManagerInterface::instance();
connect(m_updateCodeModelAction, SIGNAL(triggered()), cppModelManager, SLOT(updateModifiedSourceFiles()));
cppToolsMenu->addAction(cmd);
......
......@@ -36,9 +36,9 @@
#include <extensionsystem/pluginmanager.h>
#include <cplusplus/ModelManagerInterface.h>
#include <cpptools/cpprefactoringchanges.h>
#include <cpptools/cpptoolsconstants.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <AST.h>
#include <cplusplus/ASTPath.h>
......@@ -56,7 +56,7 @@ CppQuickFixCollector::~CppQuickFixCollector()
bool CppQuickFixCollector::supportsEditor(TextEditor::ITextEditable *editor)
{
return CppTools::CppModelManagerInterface::instance()->isCppEditor(editor);
return CPlusPlus::CppModelManagerInterface::instance()->isCppEditor(editor);
}
TextEditor::QuickFixState *CppQuickFixCollector::initializeCompletion(TextEditor::BaseTextEditor *editor)
......@@ -78,7 +78,7 @@ TextEditor::QuickFixState *CppQuickFixCollector::initializeCompletion(TextEditor
CppQuickFixState *state = new CppQuickFixState(editor);
state->_path = path;
state->_semanticInfo = info;
state->_snapshot = CppTools::CppModelManagerInterface::instance()->snapshot();
state->_snapshot = CPlusPlus::CppModelManagerInterface::instance()->snapshot();
state->_context = CPlusPlus::LookupContext(info.doc, state->snapshot());
return state;
}
......
......@@ -31,7 +31,7 @@
**
**************************************************************************/
#include "cppmodelmanagerinterface.h"
#include "abstracteditorsupport.h"
#include "cpptoolsconstants.h"
#include "cppfilesettingspage.h"
......@@ -46,6 +46,8 @@
#include <coreplugin/icore.h>
#include <QtCore/QDebug>
using namespace CPlusPlus;
namespace CppTools {
AbstractEditorSupport::AbstractEditorSupport(CppModelManagerInterface *modelmanager) :
......
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef ABSTRACTEDITORSUPPORT_H
#define ABSTRACTEDITORSUPPORT_H
#include "cpptools_global.h"
#include <cplusplus/ModelManagerInterface.h>
namespace CppTools {
class CPPTOOLS_EXPORT AbstractEditorSupport
{
public:
explicit AbstractEditorSupport(CPlusPlus::CppModelManagerInterface *modelmanager);
virtual ~AbstractEditorSupport();
virtual QByteArray contents() const = 0;
virtual QString fileName() const = 0;
void updateDocument();
// TODO: find a better place for common utility functions
static QString functionAt(const CPlusPlus::CppModelManagerInterface *mm,
const QString &fileName,
int line, int column);
static QString licenseTemplate(const QString &file = QString(), const QString &className = QString());
private:
CPlusPlus::CppModelManagerInterface *m_modelmanager;
};
}
#endif // ABSTRACTEDITORSUPPORT_H
......@@ -32,7 +32,6 @@
**************************************************************************/
#include "cppfindreferences.h"
#include "cppmodelmanagerinterface.h"
#include "cpptoolsconstants.h"
#include <texteditor/basetexteditor.h>
......@@ -54,6 +53,7 @@
#include <Names.h>
#include <Scope.h>
#include <cplusplus/ModelManagerInterface.h>
#include <cplusplus/CppDocument.h>
#include <cplusplus/Overview.h>
#include <cplusplus/FindUsages.h>
......@@ -72,7 +72,7 @@ using namespace CppTools::Internal;
using namespace CPlusPlus;
static QString getSource(const QString &fileName,
const CppTools::CppModelManagerInterface::WorkingCopy &workingCopy)
const CppModelManagerInterface::WorkingCopy &workingCopy)
{
if (workingCopy.contains(fileName)) {
return workingCopy.source(fileName);
......@@ -89,13 +89,13 @@ namespace {
class ProcessFile: public std::unary_function<QString, QList<Usage> >
{
const CppTools::CppModelManagerInterface::WorkingCopy workingCopy;
const CppModelManagerInterface::WorkingCopy workingCopy;
const Snapshot snapshot;
Document::Ptr symbolDocument;
Symbol *symbol;
public:
ProcessFile(const CppTools::CppModelManagerInterface::WorkingCopy &workingCopy,
ProcessFile(const CppModelManagerInterface::WorkingCopy &workingCopy,
const Snapshot snapshot,
Document::Ptr symbolDocument,
Symbol *symbol)
......@@ -157,7 +157,7 @@ public:
} // end of anonymous namespace
CppFindReferences::CppFindReferences(CppTools::CppModelManagerInterface *modelManager)
CppFindReferences::CppFindReferences(CppModelManagerInterface *modelManager)
: QObject(modelManager),
_modelManager(modelManager),
_resultWindow(Find::SearchResultWindow::instance())
......@@ -183,7 +183,7 @@ QList<int> CppFindReferences::references(Symbol *symbol, const LookupContext &co
}
static void find_helper(QFutureInterface<Usage> &future,
const CppTools::CppModelManagerInterface::WorkingCopy workingCopy,
const CppModelManagerInterface::WorkingCopy workingCopy,
const LookupContext context,
CppFindReferences *findRefs,
Symbol *symbol)
......@@ -260,7 +260,7 @@ void CppFindReferences::findAll_helper(Symbol *symbol, const LookupContext &cont
_resultWindow->popup(true);
const CppTools::CppModelManagerInterface::WorkingCopy workingCopy = _modelManager->workingCopy();
const CppModelManagerInterface::WorkingCopy workingCopy = _modelManager->workingCopy();
Core::ProgressManager *progressManager = Core::ICore::instance()->progressManager();
......@@ -321,12 +321,12 @@ namespace {
class FindMacroUsesInFile: public std::unary_function<QString, QList<Usage> >
{
const CppTools::CppModelManagerInterface::WorkingCopy workingCopy;
const CppModelManagerInterface::WorkingCopy workingCopy;
const Snapshot snapshot;
const Macro &macro;
public:
FindMacroUsesInFile(const CppTools::CppModelManagerInterface::WorkingCopy &workingCopy,
FindMacroUsesInFile(const CppModelManagerInterface::WorkingCopy &workingCopy,
const Snapshot snapshot,
const Macro &macro)
: workingCopy(workingCopy), snapshot(snapshot), macro(macro)
......@@ -388,7 +388,7 @@ public:
} // end of anonymous namespace
static void findMacroUses_helper(QFutureInterface<Usage> &future,
const CppTools::CppModelManagerInterface::WorkingCopy workingCopy,
const CppModelManagerInterface::WorkingCopy workingCopy,
const Snapshot snapshot,
CppFindReferences *findRefs,
const Macro macro)
......
......@@ -51,9 +51,11 @@ namespace Find {
struct SearchResultItem;
} // end of namespace Find
namespace CppTools {
namespace CPlusPlus {
class CppModelManagerInterface;
}
namespace CppTools {
namespace Internal {
class CppFindReferences: public QObject
......@@ -61,7 +63,7 @@ class CppFindReferences: public QObject
Q_OBJECT
public:
CppFindReferences(CppModelManagerInterface *modelManager);
CppFindReferences(CPlusPlus::CppModelManagerInterface *modelManager);
virtual ~CppFindReferences();
QList<int> references(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context) const;
......@@ -90,7 +92,7 @@ private:
void setDependencyTable(const CPlusPlus::DependencyTable &newTable);
private:
QPointer<CppModelManagerInterface> _modelManager;
QPointer<CPlusPlus::CppModelManagerInterface> _modelManager;
Find::SearchResultWindow *_resultWindow;
QFutureWatcher<CPlusPlus::Usage> m_watcher;
......