ProjectExplorer: Remove dedicated "DuplicateFile" ability

Duplication works for any file node whose parent project node can add
files. No need to duplicate (!) this logic everywhere.
This makes the "Duplicate File" action available for cmake, qbs, etc.

Change-Id: Id1f0378c3b3d7e2dbca4d6bbcca5df1c2d33ee0b
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2019-06-21 16:47:17 +02:00
parent 485a97d984
commit 1d589c259b
4 changed files with 5 additions and 6 deletions

View File

@@ -84,7 +84,7 @@ QmakeProFileNode *QmakePriFileNode::proFileNode() const
bool QmakePriFileNode::supportsAction(ProjectAction action, const Node *node) const
{
if (action == Rename || action == DuplicateFile) {
if (action == Rename) {
const FileNode *fileNode = node->asFileNode();
return (fileNode && fileNode->fileType() != FileType::Project)
|| dynamic_cast<const ResourceEditor::ResourceTopLevelNode *>(node);