ui: Show nodes with more than 20 children initially collapsed (issue #509)

This commit is contained in:
Eberhard Graether
2017-11-08 21:43:09 +01:00
parent 17a1f7eac9
commit 0e7dc3242d
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -925,8 +925,15 @@ std::shared_ptr<Graph> PersistentStorage::getGraphForActiveTokenIds(
}
else
{
nodeIds.push_back(elementId);
m_hierarchyCache.addFirstChildIdsForNodeId(elementId, &nodeIds, &edgeIds);
// don't expand active node if it has more than 20 child nodes
if (nodeIds.size() > 20)
{
nodeIds.clear();
}
nodeIds.push_back(elementId);
edgeIds.clear();
std::vector<StorageEdge> edges = m_sqliteIndexStorage.getEdgesBySourceOrTargetId(elementId);