TextEditor: Add a convenience overload for RefactoringFile::apply()

... and make use of it.
In most contexts, apply() immediately follows setChangeSet(), so
combining the two can save a lot of code on the call site.

Change-Id: I421001bd47000cb64678a57b19760becf59a4863
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2024-05-22 13:31:08 +02:00
parent 708adca904
commit 09f747f7d1
37 changed files with 74 additions and 141 deletions

View File

@@ -522,10 +522,7 @@ bool TextDocument::applyChangeSet(const ChangeSet &changeSet)
{
if (changeSet.isEmpty())
return true;
PlainRefactoringFileFactory changes;
const RefactoringFilePtr file = changes.file(filePath());
file->setChangeSet(changeSet);
return file->apply();
return PlainRefactoringFileFactory().file(filePath())->apply(changeSet);
}
// the blocks list must be sorted