| 280 | } |
| 281 | |
| 282 | void IntrinsicEdNodeViewTreeWidget::onDestroyComponent() |
| 283 | { |
| 284 | QTreeWidgetItem* currIt = currentItem(); |
| 285 | Components::NodeRef currentNode = _itemToNodeMap[currIt]; |
| 286 | Entity::EntityRef entity = Components::NodeManager::_entity(currentNode); |
| 287 | |
| 288 | QAction* action = (QAction*)QObject::sender(); |
| 289 | _INTR_STRING compName = action->text().toStdString().c_str(); |
| 290 | Dod::Components::ComponentManagerEntry& entry = |
| 291 | Application::_componentManagerMapping[compName]; |
| 292 | Dod::Ref componentRef = entry.getComponentForEntityFunction(entity); |
| 293 | |
| 294 | if (entry.destroyResourcesFunction) |
| 295 | { |
| 296 | Dod::RefArray components; |
| 297 | components.push_back(componentRef); |
| 298 | entry.destroyResourcesFunction(components); |
| 299 | } |
| 300 | |
| 301 | _INTR_ASSERT(entry.destroyFunction); |
| 302 | entry.destroyFunction(componentRef); |
| 303 | |
| 304 | if (entry.onInsertionDeletionFinishedAction) |
| 305 | { |
| 306 | entry.onInsertionDeletionFinishedAction(); |
| 307 | } |
| 308 | |
| 309 | onItemSelected(currIt, nullptr); |
| 310 | onPopulateNodeTree(); |
| 311 | } |
| 312 | |
| 313 | void IntrinsicEdNodeViewTreeWidget::onShowContextMenuForTreeView(QPoint p_Pos) |
| 314 | { |