Logo Search packages:      
Sourcecode: kmess version File versions  Download package

void ContactListModelItem::appendChild ( ContactListModelItem item  )  [private]

Add a new child item to this one

Insert the given item as a child of this node. A root item can only contain Groups, Groups can only contain Contacts. There cannot be duplicate items within the same parent.

Parameters:
item Item to add as child

Definition at line 102 of file contactlistmodelitem.cpp.

References getType().

Referenced by ContactListModelItem(), and moveTo().

{
  // Only add groups to the root, and contacts to groups
  if( ( itemType_ == ItemRoot    && item->getType() != ItemGroup )
  ||  ( itemType_ == ItemGroup   && item->getType() != ItemContact )
  ||    itemType_ == ItemContact )
  {
    kWarning() << "Cannot insert this item:" << item << "into this one:" << this;
    return;
  }

  // Also, don't add items which are already present
  if( childItems_.contains( item ) )
  {
    kWarning() << "Tried to add twice item:" << item;
    return;
  }

  childItems_.append( item );
}


Generated by  Doxygen 1.6.0   Back to index