ui: Fixed order of bundle nodes in graph overview

This commit is contained in:
Eberhard Graether
2017-12-11 00:05:43 +01:00
parent 0d30132cc4
commit f9fb08e490
4 changed files with 81 additions and 43 deletions
@@ -1205,8 +1205,8 @@ std::shared_ptr<DummyNode> GraphController::bundleNodesMatching(
}
std::shared_ptr<DummyNode> GraphController::bundleByType(
std::list<std::shared_ptr<DummyNode>>& nodes,
const NodeType& type,
std::list<std::shared_ptr<DummyNode>>& nodes,
const NodeType& type,
const Tree<NodeType::BundleInfo>& bundleInfoTree,
const bool considerInvisibleNodes)
{
@@ -1214,10 +1214,10 @@ std::shared_ptr<DummyNode> GraphController::bundleByType(
nodes,
[&](const DummyNode* node)
{
return
(considerInvisibleNodes || node->visible) &&
node->isGraphNode() &&
node->data->getType() == type &&
return
(considerInvisibleNodes || node->visible) &&
node->isGraphNode() &&
node->data->getType() == type &&
bundleInfoTree.data.nameMatcher(node->name);
},
bundleInfoTree.data.bundleName
@@ -1272,11 +1272,12 @@ void GraphController::bundleNodesByType()
nodes.push_back(oldNodes[i]);
}
for (const NodeType& nodeType : NodeTypeSet::all().getNodeTypes())
for (const NodeType& nodeType : NodeType::getOverviewBundleNodeTypesOrdered())
{
if (nodeType.hasOverviewBundle())
Tree<NodeType::BundleInfo> bundleInfoTree = nodeType.getOverviewBundleTree();
if (bundleInfoTree.data.isValid())
{
std::shared_ptr<DummyNode> bundleNode = bundleByType(nodes, nodeType, nodeType.getOverviewBundleTree());
std::shared_ptr<DummyNode> bundleNode = bundleByType(nodes, nodeType, bundleInfoTree);
if (bundleNode)
{
m_dummyNodes.push_back(bundleNode);