Skip to content

Commit

Permalink
Fixed freezing inspecting a TAZ with a big number of Source/sinks. Refs
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Jan 22, 2025
1 parent 635f6dc commit a19dfe0
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/netedit/frames/GNEElementTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,9 +835,14 @@ GNEElementTree::showHierarchicalElementChildren(GNEHierarchicalElement* HE, FXTr
for (const auto& additional : edge->getChildAdditionals()) {
showHierarchicalElementChildren(additional, edgeItem);
}
// insert child TAZSourceSink
for (const auto& TAZSourceSink : edge->getChildTAZSourceSinks()) {
showHierarchicalElementChildren(TAZSourceSink, edgeItem);
// avoid show a high number of TAZSource SInks
if (edge->getChildTAZSourceSinks().size() > 20) {
addListItem(edgeItem, TLF("SourceSinks (%)", toString(edge->getChildTAZSourceSinks().size())), GUIIconSubSys::getIcon(GUIIcon::TAZ), false);
} else {
// insert child TAZSourceSink
for (const auto& TAZSourceSink : edge->getChildTAZSourceSinks()) {
showHierarchicalElementChildren(TAZSourceSink, edgeItem);
}
}
// insert child demand elements
for (const auto& demandElement : edge->getChildDemandElements()) {
Expand Down Expand Up @@ -935,9 +940,14 @@ GNEElementTree::showHierarchicalElementChildren(GNEHierarchicalElement* HE, FXTr
showHierarchicalElementChildren(additional, treeItem);
}
}
// insert additional children
for (const auto& TAZSourceSink : HE->getChildTAZSourceSinks()) {
showHierarchicalElementChildren(TAZSourceSink, treeItem);
// avoid show a high number of TAZSource SInks
if (HE->getChildTAZSourceSinks().size() > 20) {
addListItem(treeItem, TLF("SourceSinks (%)", toString(HE->getChildTAZSourceSinks().size())), GUIIconSubSys::getIcon(GUIIcon::TAZ), false);
} else {
// insert child TAZSourceSink
for (const auto& TAZSourceSink : HE->getChildTAZSourceSinks()) {
showHierarchicalElementChildren(TAZSourceSink, treeItem);
}
}
// insert child demand elements
for (const auto& demandElement : HE->getChildDemandElements()) {
Expand Down

0 comments on commit a19dfe0

Please sign in to comment.