| 73 | } |
| 74 | |
| 75 | void DataSelectorManager::onChangeData(DataPtr _parent, DataTypePtr _type, bool _changeOnlySelection) |
| 76 | { |
| 77 | EventType* event = getEvent(_type->getName()); |
| 78 | if (event != nullptr) |
| 79 | { |
| 80 | event->operator()(_parent, _changeOnlySelection); |
| 81 | } |
| 82 | |
| 83 | DataPtr childSelected = nullptr; |
| 84 | if (_parent != nullptr) |
| 85 | childSelected = _parent->getChildSelected(); |
| 86 | |
| 87 | const DataType::VectorString& childs = _type->getChilds(); |
| 88 | for (const auto& childName : childs) |
| 89 | { |
| 90 | DataTypePtr childType = DataTypeManager::getInstance().getType(childName); |
| 91 | if (childType != nullptr) |
| 92 | { |
| 93 | DataPtr child = childSelected; |
| 94 | if (child != nullptr && child->getType() != childType) |
| 95 | child = nullptr; |
| 96 | |
| 97 | if (child != nullptr) |
| 98 | { |
| 99 | DataPtr subChildSelected = child->getChildSelected(); |
| 100 | if (subChildSelected == nullptr) |
| 101 | { |
| 102 | if (!child->getChilds().empty()) |
| 103 | { |
| 104 | DataPtr childData = child->getChildByIndex(0); |
| 105 | child->setChildSelected(childData); |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | onChangeData(child, childType, false); |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | } |
nothing calls this directly
no test coverage detected