TextEditor: filepathify RefactoringChanges

Change-Id: Ie97e484bcdeaa0cb2f5d04b3c79ace55ff2e426c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2021-05-28 12:02:36 +02:00
parent 15e4649fe8
commit 79b9a2fea6
21 changed files with 238 additions and 195 deletions

View File

@@ -786,8 +786,8 @@ public:
printer.showTemplateParameters = true;
Utils::ChangeSet headerChangeSet;
const CppRefactoringChanges refactoring(snapshot());
const QString filename = currentFile()->fileName();
const CppRefactoringFilePtr headerFile = refactoring.file(filename);
const Utils::FilePath filePath = currentFile()->filePath();
const CppRefactoringFilePtr headerFile = refactoring.file(filePath);
const LookupContext targetContext(headerFile->cppDocument(), snapshot());
const Class *targetClass = m_classAST->symbol;
@@ -905,7 +905,8 @@ public:
if (!clazz)
return;
CppRefactoringFilePtr implementationFile = refactoring.file(m_cppFileName);
CppRefactoringFilePtr implementationFile = refactoring.file(
Utils::FilePath::fromString(m_cppFileName));
Utils::ChangeSet implementationChangeSet;
const int insertPos = qMax(0, implementationFile->document()->characterCount() - 1);