CppEditor: Simplify CppRefactoringChanges class

Remove unneeded methods from API.
This commit is contained in:
Kai Koehne
2010-08-13 15:38:45 +02:00
parent cd5492eb14
commit a8747f32e4
3 changed files with 4 additions and 20 deletions

View File

@@ -102,7 +102,7 @@ CppQuickFixOperation::~CppQuickFixOperation()
void CppQuickFixOperation::perform() void CppQuickFixOperation::perform()
{ {
CppRefactoringChanges refactoring(_state.document(), _state.snapshot()); CppRefactoringChanges refactoring(_state.snapshot());
CppRefactoringFile current = refactoring.file(fileName()); CppRefactoringFile current = refactoring.file(fileName());
performChanges(&current, &refactoring); performChanges(&current, &refactoring);

View File

@@ -41,31 +41,19 @@ using namespace CppEditor;
using namespace CPlusPlus; using namespace CPlusPlus;
using namespace Utils; using namespace Utils;
CppRefactoringChanges::CppRefactoringChanges(const Document::Ptr &thisDocument, const Snapshot &snapshot) CppRefactoringChanges::CppRefactoringChanges(const Snapshot &snapshot)
: m_thisDocument(thisDocument) : m_snapshot(snapshot)
, m_snapshot(snapshot)
, m_context(m_thisDocument, m_snapshot)
, m_modelManager(CppTools::CppModelManagerInterface::instance()) , m_modelManager(CppTools::CppModelManagerInterface::instance())
{ {
Q_ASSERT(m_modelManager); Q_ASSERT(m_modelManager);
m_workingCopy = m_modelManager->workingCopy(); m_workingCopy = m_modelManager->workingCopy();
} }
Document::Ptr CppRefactoringChanges::thisDocument() const
{
return m_thisDocument;
}
const Snapshot &CppRefactoringChanges::snapshot() const const Snapshot &CppRefactoringChanges::snapshot() const
{ {
return m_snapshot; return m_snapshot;
} }
const LookupContext &CppRefactoringChanges::context() const
{
return m_context;
}
CppRefactoringFile CppRefactoringChanges::file(const QString &fileName) CppRefactoringFile CppRefactoringChanges::file(const QString &fileName)
{ {
return CppRefactoringFile(fileName, this); return CppRefactoringFile(fileName, this);

View File

@@ -82,13 +82,9 @@ private:
class CPPEDITOR_EXPORT CppRefactoringChanges: public TextEditor::RefactoringChanges class CPPEDITOR_EXPORT CppRefactoringChanges: public TextEditor::RefactoringChanges
{ {
public: public:
CppRefactoringChanges(const CPlusPlus::Document::Ptr &thisDocument, CppRefactoringChanges(const CPlusPlus::Snapshot &snapshot);
const CPlusPlus::Snapshot &snapshot);
CPlusPlus::Document::Ptr thisDocument() const;
const CPlusPlus::Snapshot &snapshot() const; const CPlusPlus::Snapshot &snapshot() const;
const CPlusPlus::LookupContext &context() const;
CppRefactoringFile file(const QString &fileName); CppRefactoringFile file(const QString &fileName);
private: private: