ProjectExplorer: Fix "Remove subproject" functionality

This was completely broken: Both The qmake-specific logic for enabling
the menu item and the generic code executing the action operated on the
wrong nodes.

Change-Id: Ic6af6f87999dfd3b939f185312be944750b21fa9
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2019-02-20 17:44:14 +01:00
parent da01512676
commit 434c960243
3 changed files with 12 additions and 7 deletions

View File

@@ -132,7 +132,7 @@ bool QmakePriFileNode::supportsAction(ProjectAction action, const Node *node) co
break;
}
case ProjectType::SubDirsTemplate:
if (action == AddSubProject || action == RemoveSubProject)
if (action == AddSubProject)
return true;
break;
default:
@@ -347,6 +347,13 @@ bool QmakeProFileNode::includedInExactParse() const
return pro && pro->includedInExactParse();
}
bool QmakeProFileNode::supportsAction(ProjectAction action, const Node *node) const
{
if (action == RemoveSubProject)
return parentProjectNode() && !parentProjectNode()->asContainerNode();
return QmakePriFileNode::supportsAction(action, node);
}
FolderNode::AddNewInformation QmakeProFileNode::addNewInformation(const QStringList &files, Node *context) const
{
Q_UNUSED(files)