QbsProjectManager: Do not offer to remove qbs files in context menu.

Such build system files must be filtered out, as they do not appear on
the right-hand side of "files" properties and have completely different
remove semantics.

Change-Id: I3963aa853003f4d674392434529dab19749af25b
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Christian Kandeler
2014-09-11 16:01:11 +02:00
parent 17bc4551ef
commit 686bce1663

View File

@@ -328,9 +328,13 @@ bool QbsBaseProjectNode::renameFile(const QString &filePath, const QString &newF
static QList<ProjectExplorer::ProjectAction> supportedNodeActions(ProjectExplorer::Node *node)
{
QList<ProjectExplorer::ProjectAction> actions;
if (parentQbsProjectNode(node)->project()->isProjectEditable()) {
actions << ProjectExplorer::AddNewFile << ProjectExplorer::AddExistingFile
<< ProjectExplorer::RemoveFile;
const QbsProject * const project = parentQbsProjectNode(node)->project();
if (!project->isProjectEditable())
return actions;
actions << ProjectExplorer::AddNewFile << ProjectExplorer::AddExistingFile;
if (node->nodeType() == ProjectExplorer::FileNodeType
&& !project->qbsProject().buildSystemFiles().contains(node->path())) {
actions << ProjectExplorer::RemoveFile;
}
return actions;
}