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:
hjk
2019-02-26 17:44:56 +01:00
parent ce9b3358fb
commit ad4e2562fa
16 changed files with 74 additions and 83 deletions

View File

@@ -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;