Expose CppModelManagerInterface::workingCopy()

This commit is contained in:
Roberto Raggi
2009-10-12 10:38:00 +02:00
parent db14533928
commit 420b09e8c2
5 changed files with 16 additions and 9 deletions

View File

@@ -28,7 +28,7 @@
**************************************************************************/
#include "cppfindreferences.h"
#include "cppmodelmanager.h"
#include "cppmodelmanagerinterface.h"
#include "cpptoolsconstants.h"
#include <texteditor/basetexteditor.h>
@@ -452,7 +452,7 @@ private:
} // end of anonymous namespace
CppFindReferences::CppFindReferences(CppModelManager *modelManager)
CppFindReferences::CppFindReferences(CppTools::CppModelManagerInterface *modelManager)
: _modelManager(modelManager),
_resultWindow(ExtensionSystem::PluginManager::instance()->getObject<Find::SearchResultWindow>())
{
@@ -614,7 +614,7 @@ void CppFindReferences::findAll_helper(Symbol *symbol)
_resultWindow->popup(true);
const Snapshot snapshot = _modelManager->snapshot();
const QMap<QString, QString> wl = _modelManager->buildWorkingCopyList();
const QMap<QString, QString> wl = _modelManager->workingCopy();
Core::ProgressManager *progressManager = Core::ICore::instance()->progressManager();

View File

@@ -43,16 +43,16 @@ namespace Find {
} // end of namespace Find
namespace CppTools {
namespace Internal {
class CppModelManagerInterface;
class CppModelManager;
namespace Internal {
class CppFindReferences: public QObject
{
Q_OBJECT
public:
CppFindReferences(CppModelManager *modelManager);
CppFindReferences(CppModelManagerInterface *modelManager);
virtual ~CppFindReferences();
QList<int> references(CPlusPlus::Symbol *symbol,
@@ -76,7 +76,7 @@ private:
void findAll_helper(CPlusPlus::Symbol *symbol);
private:
QPointer<CppModelManager> _modelManager;
QPointer<CppModelManagerInterface> _modelManager;
Find::SearchResultWindow *_resultWindow;
QFutureWatcher<Utils::FileSearchResult> m_watcher;
};

View File

@@ -793,6 +793,11 @@ QMap<QString, QString> CppModelManager::buildWorkingCopyList()
return workingCopy;
}
QMap<QString, QString> CppModelManager::workingCopy() const
{
return const_cast<CppModelManager *>(this)->buildWorkingCopyList();
}
void CppModelManager::updateSourceFiles(const QStringList &sourceFiles)
{ (void) refreshSourceFiles(sourceFiles); }

View File

@@ -73,6 +73,7 @@ public:
virtual ~CppModelManager();
virtual void updateSourceFiles(const QStringList &sourceFiles);
virtual QMap<QString, QString> workingCopy() const;
virtual QList<ProjectInfo> projectInfos() const;
virtual ProjectInfo projectInfo(ProjectExplorer::Project *project) const;
@@ -92,8 +93,6 @@ public:
CppEditorSupport *editorSupport(TextEditor::ITextEditor *editor) const
{ return m_editorSupport.value(editor); }
QMap<QString, QString> buildWorkingCopyList();
void emitDocumentUpdated(CPlusPlus::Document::Ptr doc);
void stopEditorSelectionsUpdate()
@@ -132,6 +131,8 @@ private Q_SLOTS:
void updateEditorSelections();
private:
QMap<QString, QString> buildWorkingCopyList();
QStringList projectFiles()
{
ensureUpdated();

View File

@@ -86,6 +86,7 @@ public:
virtual void GC() = 0;
virtual void updateSourceFiles(const QStringList &sourceFiles) = 0;
virtual QMap<QString, QString> workingCopy() const = 0;
virtual CPlusPlus::Snapshot snapshot() const = 0;
virtual QList<ProjectInfo> projectInfos() const = 0;