From a8747f32e4c8c4c0b800eb9eb026057350a1d4b6 Mon Sep 17 00:00:00 2001 From: Kai Koehne <kai.koehne@nokia.com> Date: Fri, 13 Aug 2010 15:38:45 +0200 Subject: [PATCH] CppEditor: Simplify CppRefactoringChanges class Remove unneeded methods from API. --- src/plugins/cppeditor/cppquickfix.cpp | 2 +- src/plugins/cppeditor/cpprefactoringchanges.cpp | 16 ++-------------- src/plugins/cppeditor/cpprefactoringchanges.h | 6 +----- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/plugins/cppeditor/cppquickfix.cpp b/src/plugins/cppeditor/cppquickfix.cpp index 49d56dc9367..9d1c0806093 100644 --- a/src/plugins/cppeditor/cppquickfix.cpp +++ b/src/plugins/cppeditor/cppquickfix.cpp @@ -102,7 +102,7 @@ CppQuickFixOperation::~CppQuickFixOperation() void CppQuickFixOperation::perform() { - CppRefactoringChanges refactoring(_state.document(), _state.snapshot()); + CppRefactoringChanges refactoring(_state.snapshot()); CppRefactoringFile current = refactoring.file(fileName()); performChanges(¤t, &refactoring); diff --git a/src/plugins/cppeditor/cpprefactoringchanges.cpp b/src/plugins/cppeditor/cpprefactoringchanges.cpp index 762c4cab126..842e6294a82 100644 --- a/src/plugins/cppeditor/cpprefactoringchanges.cpp +++ b/src/plugins/cppeditor/cpprefactoringchanges.cpp @@ -41,31 +41,19 @@ using namespace CppEditor; using namespace CPlusPlus; using namespace Utils; -CppRefactoringChanges::CppRefactoringChanges(const Document::Ptr &thisDocument, const Snapshot &snapshot) - : m_thisDocument(thisDocument) - , m_snapshot(snapshot) - , m_context(m_thisDocument, m_snapshot) +CppRefactoringChanges::CppRefactoringChanges(const Snapshot &snapshot) + : m_snapshot(snapshot) , m_modelManager(CppTools::CppModelManagerInterface::instance()) { Q_ASSERT(m_modelManager); m_workingCopy = m_modelManager->workingCopy(); } -Document::Ptr CppRefactoringChanges::thisDocument() const -{ - return m_thisDocument; -} - const Snapshot &CppRefactoringChanges::snapshot() const { return m_snapshot; } -const LookupContext &CppRefactoringChanges::context() const -{ - return m_context; -} - CppRefactoringFile CppRefactoringChanges::file(const QString &fileName) { return CppRefactoringFile(fileName, this); diff --git a/src/plugins/cppeditor/cpprefactoringchanges.h b/src/plugins/cppeditor/cpprefactoringchanges.h index 92b8c575f65..cb2f83c7cc5 100644 --- a/src/plugins/cppeditor/cpprefactoringchanges.h +++ b/src/plugins/cppeditor/cpprefactoringchanges.h @@ -82,13 +82,9 @@ private: class CPPEDITOR_EXPORT CppRefactoringChanges: public TextEditor::RefactoringChanges { public: - CppRefactoringChanges(const CPlusPlus::Document::Ptr &thisDocument, - const CPlusPlus::Snapshot &snapshot); + CppRefactoringChanges(const CPlusPlus::Snapshot &snapshot); - CPlusPlus::Document::Ptr thisDocument() const; const CPlusPlus::Snapshot &snapshot() const; - const CPlusPlus::LookupContext &context() const; - CppRefactoringFile file(const QString &fileName); private: -- GitLab