mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-14 11:46:34 +02:00
use const ref on pointer, and use dynamic_cast
This commit is contained in:
parent
b16d666026
commit
f5f1a64c92
1 changed files with 2 additions and 2 deletions
|
@ -113,7 +113,7 @@ void EntityTree::readBitstreamToTree(const unsigned char* bitstream,
|
|||
// add entities
|
||||
QHash<EntityItemID, EntityItemPointer>::const_iterator itr;
|
||||
for (itr = _entitiesToAdd.constBegin(); itr != _entitiesToAdd.constEnd(); ++itr) {
|
||||
EntityItemPointer entityItem = itr.value();
|
||||
EntityItemPointer& entityItem = itr.value();
|
||||
AddEntityOperator theOperator(getThisPointer(), entityItem);
|
||||
recurseTreeWithOperator(&theOperator);
|
||||
postAddEntity(entityItem);
|
||||
|
@ -560,7 +560,7 @@ void EntityTree::deleteEntity(const EntityItemID& entityID, bool force, bool ign
|
|||
auto descendantID = descendant->getID();
|
||||
theOperator.addEntityIDToDeleteList(descendantID);
|
||||
emit deletingEntity(descendantID);
|
||||
EntityItemPointer descendantEntity = std::static_pointer_cast<EntityItem>(descendant);
|
||||
EntityItemPointer descendantEntity = std::dynamic_pointer_cast<EntityItem>(descendant);
|
||||
if (descendantEntity) {
|
||||
emit deletingEntityPointer(descendantEntity.get());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue