forked from qt-creator/qt-creator
		
	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:
		@@ -110,13 +110,13 @@ CppRefactoringFile::CppRefactoringFile(const QString &fileName, CppRefactoringCh
 | 
			
		||||
    m_cppDocument = snapshot.document(fileName);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
CppRefactoringFile::CppRefactoringFile(TextEditor::BaseTextEditorWidget *editor, CPlusPlus::Document::Ptr document)
 | 
			
		||||
    : RefactoringFile()
 | 
			
		||||
    , m_cppDocument(document)
 | 
			
		||||
{
 | 
			
		||||
    m_fileName = document->fileName();
 | 
			
		||||
    m_editor = editor;
 | 
			
		||||
}
 | 
			
		||||
CppRefactoringFile::CppRefactoringFile(QTextDocument *document, const QString &fileName)
 | 
			
		||||
    : RefactoringFile(document, fileName)
 | 
			
		||||
{ }
 | 
			
		||||
 | 
			
		||||
CppRefactoringFile::CppRefactoringFile(TextEditor::BaseTextEditorWidget *editor)
 | 
			
		||||
    : RefactoringFile(editor)
 | 
			
		||||
{ }
 | 
			
		||||
 | 
			
		||||
Document::Ptr CppRefactoringFile::cppDocument() const
 | 
			
		||||
{
 | 
			
		||||
@@ -134,6 +134,11 @@ Document::Ptr CppRefactoringFile::cppDocument() const
 | 
			
		||||
    return m_cppDocument;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CppRefactoringFile::setCppDocument(Document::Ptr document)
 | 
			
		||||
{
 | 
			
		||||
    m_cppDocument = document;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Scope *CppRefactoringFile::scopeAt(unsigned index) const
 | 
			
		||||
{
 | 
			
		||||
    unsigned line, column;
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user