QmlProjectNode: fix coverity warning

Change-Id: I83d2684f4adb9f969824e202da2261b37a699a68
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Nikita Baryshnikov
2017-08-13 16:22:19 +03:00
parent d571b5051e
commit 2a62a72c69

View File

@@ -61,9 +61,11 @@ bool QmlProjectNode::supportsAction(ProjectAction action, const Node *node) cons
{
if (action == AddNewFile || action == EraseFile)
return true;
QTC_ASSERT(node, return false);
if (action == Rename && node->nodeType() == NodeType::File) {
const FileNode *fileNode = dynamic_cast<const FileNode *>(node);
const FileNode *fileNode = node->asFileNode();
QTC_ASSERT(fileNode, return false);
return fileNode->fileType() != FileType::Project;
}