src: replaced usage of NodeType::Type in MessageActivateTrail creation

This commit is contained in:
mlangkabel
2017-11-23 17:56:47 +01:00
parent bdb68a9aef
commit 1a9d2b8eab
+20 -25
View File
@@ -658,36 +658,31 @@ MessageActivateTrail QtGraphView::getMessageActivateTrail(bool forward)
{ {
MessageActivateTrail message(0, 0, 0, 0, false); MessageActivateTrail message(0, 0, 0, 0, false);
QtGraphNodeData* node = nullptr; QtGraphNodeData* node = dynamic_cast<QtGraphNodeData*>(m_oldActiveNode);
if (m_oldActiveNode && (node = dynamic_cast<QtGraphNodeData*>(m_oldActiveNode))) if (node)
{ {
Edge::TypeMask trailType; Edge::TypeMask trailType;
bool horizontalLayout = true; bool horizontalLayout = true;
switch (node->getData()->getType().getType()) if (node->getData()->getType().isInheritable())
{ {
case NodeType::NODE_SYMBOL: trailType = Edge::EDGE_INHERITANCE;
case NodeType::NODE_CLASS: horizontalLayout = false;
case NodeType::NODE_STRUCT: }
case NodeType::NODE_INTERFACE: else if (node->getData()->getType().isCallable())
trailType = Edge::EDGE_INHERITANCE; {
horizontalLayout = false; trailType = Edge::EDGE_CALL | Edge::EDGE_OVERRIDE |
break; Edge::EDGE_TEMPLATE_SPECIALIZATION | Edge::EDGE_TEMPLATE_MEMBER_SPECIALIZATION;
horizontalLayout = true;
case NodeType::NODE_FUNCTION: }
case NodeType::NODE_METHOD: else if (node->getData()->getType().isFile())
trailType = Edge::EDGE_CALL | Edge::EDGE_OVERRIDE | {
Edge::EDGE_TEMPLATE_SPECIALIZATION | Edge::EDGE_TEMPLATE_MEMBER_SPECIALIZATION; trailType = Edge::EDGE_INCLUDE;
horizontalLayout = true; horizontalLayout = true;
break; }
else
case NodeType::NODE_FILE: {
trailType = Edge::EDGE_INCLUDE; return message;
horizontalLayout = true;
break;
default:
return message;
} }
Id tokenId = node->getData()->getId(); Id tokenId = node->getData()->getId();