forked from qt-creator/qt-creator
Wizards: Format generated code according to current style
Needs ClangFormat to be enabled. Task-number: QTCREATORBUG-25065 Change-Id: I127da0f9ac55af7f19dead19b28470a9b72c4ee5 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -165,12 +165,16 @@ bool BaseFileWizardFactory::postGenerateOpenEditors(const GeneratedFiles &l, QSt
|
||||
{
|
||||
for (const GeneratedFile &file : std::as_const(l)) {
|
||||
if (file.attributes() & GeneratedFile::OpenEditorAttribute) {
|
||||
if (!EditorManager::openEditor(file.filePath(), file.editorId())) {
|
||||
if (errorMessage)
|
||||
*errorMessage = Tr::tr("Failed to open an editor for \"%1\".").
|
||||
arg(file.filePath().toUserOutput());
|
||||
IEditor * const editor = EditorManager::openEditor(file.filePath(), file.editorId());
|
||||
if (!editor) {
|
||||
if (errorMessage) {
|
||||
*errorMessage = Tr::tr("Failed to open an editor for \"%1\".")
|
||||
.arg(file.filePath().toUserOutput());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
editor->document()->formatContents();
|
||||
editor->document()->save(nullptr);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user