MCPcopy Create free account
hub / github.com/aldelaro5/dolphin-memory-engine / updateStructNode

Method updateStructNode

Source/GUI/MemWatcher/MemWatchModel.cpp:965–995  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

963}
964
965void MemWatchModel::updateStructNode(MemWatchTreeNode* node)
966{
967 const QString structName = node->getEntry()->getStructName();
968
969 if (!m_structDefMap.contains(structName) || m_structDefMap[structName]->getFields().isEmpty())
970 {
971 while (node->hasChildren())
972 deleteNode(getIndexFromTreeNode(node->getChildren()[0]));
973 return;
974 }
975
976 bool isExpanded{node->isExpanded()};
977
978 if (!node->hasChildren())
979 {
980 addNodes({new MemWatchTreeNode(new MemWatchEntry(m_placeholderEntry))},
981 getIndexFromTreeNode(node), true);
982 }
983 else if (node->hasChildren() && isExpanded)
984 {
985 // Shortcut for deleting all children and adding the placeholder child. Also overrides expanded
986 // state, so need to capture above and use below
987 collapseStructNode(node);
988 }
989
990 if (isExpanded)
991 {
992 if (m_structDefMap.contains(structName))
993 expandStructNode(node);
994 }
995}
996
997void MemWatchModel::expandContainerNode(MemWatchTreeNode* node)
998{

Callers

nothing calls this directly

Calls 5

getFieldsMethod · 0.80
getStructNameMethod · 0.45
getEntryMethod · 0.45
hasChildrenMethod · 0.45
isExpandedMethod · 0.45

Tested by

no test coverage detected