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:
@@ -868,9 +868,8 @@ public:
|
||||
|
||||
// Write header file
|
||||
if (!headerChangeSet.isEmpty()) {
|
||||
headerFile->setChangeSet(headerChangeSet);
|
||||
headerFile->setOpenEditor(true, m_insertPosDecl);
|
||||
headerFile->apply();
|
||||
headerFile->apply(headerChangeSet);
|
||||
}
|
||||
|
||||
// Insert in implementation file
|
||||
@@ -921,10 +920,8 @@ public:
|
||||
implementationChangeSet.insert(insertPos, QLatin1String("\n\n") + defText);
|
||||
}
|
||||
|
||||
if (!implementationChangeSet.isEmpty()) {
|
||||
implementationFile->setChangeSet(implementationChangeSet);
|
||||
implementationFile->apply();
|
||||
}
|
||||
if (!implementationChangeSet.isEmpty())
|
||||
implementationFile->apply(implementationChangeSet);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user