QbsProjectManager: Add new files to the top-level product

... by default. The "New File" wizard, if not invoked from the context
menu, implicitly prefers Groups over Products, because the respective
nodes are tried first. Thus, we lower the priority of group nodes so
that their parent product will be a better match unless the group was
specifically selected.

Task-number: QTCREATORBUG-20480
Change-Id: I0c5b2dbf861065ee97ab957ec8bd86132295893e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Christian Kandeler
2018-05-24 17:01:10 +02:00
parent 4f3e1b6024
commit 491b057d14
2 changed files with 11 additions and 0 deletions

View File

@@ -353,6 +353,15 @@ bool QbsGroupNode::renameFile(const QString &filePath, const QString &newFilePat
prdNode->qbsProductData(), m_qbsGroupData);
}
FolderNode::AddNewInformation QbsGroupNode::addNewInformation(const QStringList &files,
Node *context) const
{
AddNewInformation info = QbsBaseProjectNode::addNewInformation(files, context);
if (context != this)
--info.priority;
return info;
}
// --------------------------------------------------------------------
// QbsProductNode:
// --------------------------------------------------------------------