forked from qt-creator/qt-creator
ProjectExplorer: Replace Node::setNodeType by virtual functions
Not the usual direction of change, but currently there are several systems to identify or invoke node functionality. Virtual functions are likely to stay in this context, so this here attempts to help consolidation by reducing the influence of the node type flags, hopefully leading to full removal by making remaining functionality available through the other mechanisms (virtual functions, asFooNode() 'casts', less so the FileType flag). Change-Id: I12a17ce30b3c8883995b29b4720408020ee0fa3e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -298,7 +298,7 @@ void QmlPreviewPlugin::setFileLoader(QmlPreviewFileLoader fileLoader)
|
||||
void QmlPreviewPlugin::previewCurrentFile()
|
||||
{
|
||||
const Node *currentNode = ProjectTree::findCurrentNode();
|
||||
if (!currentNode || currentNode->nodeType() != NodeType::File
|
||||
if (!currentNode || !currentNode->isFileNodeType()
|
||||
|| currentNode->asFileNode()->fileType() != FileType::QML)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user