forked from qt-creator/qt-creator
Fix soft assert when adding file to subfolder in generic project
We can only select a node directly in the wizard summary page's project tree, if that is actually listed there. Task-number: QTCREATORBUG-21342 Change-Id: I52b3db8c38ae2bb59b3f6856e79354ca60a00140 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -456,10 +456,11 @@ void ProjectWizardPage::initializeProjectTree(Node *context, const QStringList &
|
||||
}
|
||||
root->prependChild(createNoneNode(&selector));
|
||||
|
||||
// Set combobox to context node:
|
||||
// Set combobox to context node if that appears in the tree:
|
||||
auto predicate = [context](TreeItem *ti) { return static_cast<AddNewTree*>(ti)->node() == context; };
|
||||
TreeItem *contextItem = root->findAnyChild(predicate);
|
||||
m_ui->projectComboBox->setCurrentIndex(m_model.indexForItem(contextItem));
|
||||
if (contextItem)
|
||||
m_ui->projectComboBox->setCurrentIndex(m_model.indexForItem(contextItem));
|
||||
|
||||
setAdditionalInfo(selector.deployingProjects());
|
||||
setBestNode(selector.bestChoice());
|
||||
|
Reference in New Issue
Block a user