forked from qt-creator/qt-creator
ProjectExplorer: Set temporary flag on scratch buffer document
Task-number: QTCREATORBUG-23509 Change-Id: Ieb3922030cb1dd4984b91ac24d0396bb19a4a711 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "../projectexplorerconstants.h"
|
||||
#include "../projecttree.h"
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
@@ -465,11 +466,14 @@ void JsonWizard::openFiles(const JsonWizard::GeneratorFiles &files)
|
||||
openedSomething = true;
|
||||
}
|
||||
if (file.attributes() & Core::GeneratedFile::OpenEditorAttribute) {
|
||||
if (!Core::EditorManager::openEditor(file.path(), file.editorId())) {
|
||||
Core::IEditor *editor = Core::EditorManager::openEditor(file.path(), file.editorId());
|
||||
if (!editor) {
|
||||
errorMessage = QCoreApplication::translate("ProjectExplorer::JsonWizard",
|
||||
"Failed to open an editor for \"%1\".")
|
||||
.arg(QDir::toNativeSeparators(file.path()));
|
||||
break;
|
||||
} else if (file.attributes() & Core::GeneratedFile::TemporaryFile) {
|
||||
editor->document()->setTemporary(true);
|
||||
}
|
||||
openedSomething = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user