forked from qt-creator/qt-creator
QbsProjectManager: Fix "Build product" action for files in groups
Change-Id: Ia557d51654ee98d89f5c2c5e4df2a1b7d32afb66 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -322,10 +322,13 @@ void QbsProjectManagerPlugin::updateBuildActions()
|
|||||||
fileName = editorNode->filePath().fileName();
|
fileName = editorNode->filePath().fileName();
|
||||||
|
|
||||||
ProjectNode *parentProjectNode = editorNode->parentProjectNode();
|
ProjectNode *parentProjectNode = editorNode->parentProjectNode();
|
||||||
|
const QbsProductNode *productNode = nullptr;
|
||||||
|
for (const ProjectNode *potentialProductNode = parentProjectNode;
|
||||||
|
potentialProductNode && !productNode;
|
||||||
|
potentialProductNode = potentialProductNode->parentProjectNode()) {
|
||||||
|
productNode = dynamic_cast<const QbsProductNode *>(potentialProductNode);
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME: This code is wrong: If the file is in a Group, then productNode will be
|
|
||||||
// null and the action will be disabled. We have to walk up the tree.
|
|
||||||
auto productNode = dynamic_cast<QbsProductNode *>(parentProjectNode);
|
|
||||||
if (productNode) {
|
if (productNode) {
|
||||||
productVisible = true;
|
productVisible = true;
|
||||||
productName = productNode->displayName();
|
productName = productNode->displayName();
|
||||||
|
|||||||
Reference in New Issue
Block a user