Changeset 2977

Show
Ignore:
Timestamp:
04/28/06 05:55:24 (3 years ago)
Author:
madcat
Message:

Fixed 'child added' handling for Object hierarchy.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • hydranode/hncgcomm/cgcomm.cpp

    r2961 r2977  
    10231023                case OC_CADDED: { 
    10241024                        uint32_t id = Utils::getVal<uint32_t>(i); 
     1025                        ObjectPtr parent = findObject(id); 
    10251026                        ObjectPtr child = readObject(i); 
    10261027                        ObjectPtr found = findObject(child->getId()); 
     
    10311032                        } else { 
    10321033                                m_objects[child->getId()] = child; 
     1034                                if (parent) { 
     1035                                        parent->m_childIds.insert(id); 
     1036                                        parent->m_children[id] = child; 
     1037                                        parent->childAdded(parent, child); 
     1038                                        child->m_parent = parent; 
     1039                                } 
    10331040                        } 
    1034                         ObjectPtr parent = findObject(id); 
    1035                         if (parent) { 
    1036                                 parent->m_childIds.insert(id); 
    1037                                 parent->m_children[id] = child; 
    1038                                 parent->childAdded(parent, child); 
    1039                                 child->m_parent = parent; 
    1040                         } 
     1041                        addedObject(child); 
    10411042                        break; 
    10421043                } 
     
    10511052                                parent->childRemoved(parent, child); 
    10521053                        } 
    1053                         removedObject(child); 
     1054                        if (child) { 
     1055                                removedObject(child); 
     1056                        } 
    10541057                        break; 
    10551058                }