C++: Synchronize function decl/def refactoring.

When editing a function declaration or definition the code model
may realize the same changes have to be applied somewhere else. A
refactoring marker will pop up that can be clicked to perform the
changes. Alternatively, press enter to apply.

Change-Id: I2299a2ecfb6a8f87d4853fc7cfa99486f890a1d3
Reviewed-on: http://codereview.qt.nokia.com/2909
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
This commit is contained in:
Christian Kamm
2011-08-10 09:50:04 +02:00
parent 13c8f9eaaa
commit 8f14bc0ea2
14 changed files with 973 additions and 92 deletions

View File

@@ -50,10 +50,11 @@ class CPPTOOLS_EXPORT CppRefactoringFile: public TextEditor::RefactoringFile
{
public:
CppRefactoringFile();
CppRefactoringFile(const QString &fileName, CppRefactoringChanges *refactoringChanges);
CppRefactoringFile(TextEditor::BaseTextEditorWidget *editor, CPlusPlus::Document::Ptr document);
CppRefactoringFile(QTextDocument *document, const QString &fileName = QString());
CppRefactoringFile(TextEditor::BaseTextEditorWidget *editor);
CPlusPlus::Document::Ptr cppDocument() const;
void setCppDocument(CPlusPlus::Document::Ptr document);
CPlusPlus::Scope *scopeAt(unsigned index) const;
@@ -76,10 +77,15 @@ public:
using TextEditor::RefactoringFile::textOf;
QString textOf(const CPlusPlus::AST *ast) const;
protected:
CppRefactoringFile(const QString &fileName, CppRefactoringChanges *refactoringChanges);
private:
CppRefactoringChanges *refactoringChanges() const;
mutable CPlusPlus::Document::Ptr m_cppDocument;
friend class CppRefactoringChanges; // for access to constructor
};
class CPPTOOLS_EXPORT CppRefactoringChanges: public TextEditor::RefactoringChanges