forked from qt-creator/qt-creator
Refactoring changes: Cleanup and improvements.
Previously RefactoringFiles were usually passed around by value. However, since a RefactoringFile may sometimes own a QTextDocument (when it was read from a file), that's not great and caused the file to be reread after every copy. With this change RefactoringFile becomes noncopyable and is always owned by a shared pointer. This change also allowed having const RefactoringFiles which is useful because they can be safely used from other threads. See CppRefactoringChanges::fileNoEditor. Change-Id: I9045921d6d0f6349f9558ff2a3d8317ea172193b Reviewed-on: http://codereview.qt.nokia.com/3084 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
This commit is contained in:
@@ -39,11 +39,10 @@
|
||||
#include <CPlusPlusForwardDeclarations.h>
|
||||
|
||||
#include <cplusplus/CppDocument.h>
|
||||
#include <cpptools/cpprefactoringchanges.h>
|
||||
|
||||
namespace CppTools {
|
||||
|
||||
class CppRefactoringChanges;
|
||||
|
||||
class CPPTOOLS_EXPORT InsertionLocation
|
||||
{
|
||||
public:
|
||||
@@ -100,7 +99,7 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
InsertionPointLocator(CppRefactoringChanges *refactoringChanges);
|
||||
InsertionPointLocator(const CppRefactoringChanges &refactoringChanges);
|
||||
|
||||
InsertionLocation methodDeclarationInClass(const QString &fileName,
|
||||
const CPlusPlus::Class *clazz,
|
||||
@@ -109,7 +108,7 @@ public:
|
||||
QList<InsertionLocation> methodDefinition(CPlusPlus::Declaration *declaration) const;
|
||||
|
||||
private:
|
||||
CppRefactoringChanges *m_refactoringChanges;
|
||||
CppRefactoringChanges m_refactoringChanges;
|
||||
};
|
||||
|
||||
} // namespace CppTools
|
||||
|
||||
Reference in New Issue
Block a user