Commit 6a8349c9 authored by Daniel Teske's avatar Daniel Teske

JsonSummaryPage: Fix selection of best project node

Broke in 7db9c37b, which accidently
resulted in passing in a empty list to initializeProjectTree

Task-number: QTCREATORBUG-13406
Change-Id: I24aa52fef0eaebb335624f8e31cd05778a2da6a2
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent d52bb24e
......@@ -108,18 +108,23 @@ void JsonSummaryPage::initializePage()
IWizardFactory::WizardKind kind = wizardKind(m_wizard);
bool isProject = (kind == IWizardFactory::ProjectWizard);
QStringList projectFiles;
QStringList files;
if (isProject) {
JsonWizard::GeneratorFile f
= Utils::findOrDefault(m_fileList, [](const JsonWizard::GeneratorFile &f) {
return f.file.attributes() & GeneratedFile::OpenProjectAttribute;
});
projectFiles << f.file.path();
files << f.file.path();
} else {
files = Utils::transform(m_fileList,
[](const JsonWizard::GeneratorFile &f) {
return f.file.path();
});
}
Node *contextNode = m_wizard->value(QLatin1String(Constants::PREFERRED_PROJECT_NODE))
.value<Node *>();
initializeProjectTree(contextNode, projectFiles, kind,
initializeProjectTree(contextNode, files, kind,
isProject ? AddSubProject : AddNewFile);
initializeVersionControls();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment