forked from qt-creator/qt-creator
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:
@@ -71,10 +71,7 @@ QString ClangFixItOperation::firstRefactoringFileContent_forTestOnly() const
|
||||
void ClangFixItOperation::applyFixitsToFile(TextEditor::RefactoringFile &refactoringFile,
|
||||
const QList<ClangFixIt> fixIts)
|
||||
{
|
||||
const Utils::ChangeSet changeSet = toChangeSet(refactoringFile, fixIts);
|
||||
|
||||
refactoringFile.setChangeSet(changeSet);
|
||||
refactoringFile.apply();
|
||||
refactoringFile.apply(toChangeSet(refactoringFile, fixIts));
|
||||
}
|
||||
|
||||
Utils::ChangeSet ClangFixItOperation::toChangeSet(
|
||||
|
||||
Reference in New Issue
Block a user