| 417 | } |
| 418 | |
| 419 | void 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 | |
| 443 | void StructSelectModel::replaceDef(const QString& name, StructDef* structDef) |
| 444 | { |
no test coverage detected