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

Method insertNewDef

Source/GUI/StructEditor/StructSelectModel.cpp:419–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417}
418
419void StructSelectModel::insertNewDef(const QString& name, StructDef* structDef)
420{
421 StructTreeNode* curNode = m_rootNode->findDeepestAvailableNode(name);
422 QStringList ids = name.split("::");
423
424 if (!curNode->getNameSpace().isEmpty())
425 {
426 int levels = static_cast<int>(curNode->getNameSpace().split("::").count());
427 for (int i = 0; i < levels; ++i)
428 ids.removeFirst();
429 }
430
431 while (ids.count() > 0)
432 {
433 QString nextID = ids.takeFirst();
434 if (ids.count() > 0)
435 curNode = addGroup(nextID, getIndexFromTreeNode(curNode));
436 else
437 {
438 curNode = addStruct(nextID, getIndexFromTreeNode(curNode), structDef);
439 }
440 }
441}
442
443void StructSelectModel::replaceDef(const QString& name, StructDef* structDef)
444{

Callers 1

Calls 2

getNameSpaceMethod · 0.80

Tested by

no test coverage detected