RosterItem *RosterGroup::get_item(const QString &jid) const { RosterTreeNode *c = 0; QVectorIterator<RosterTreeNode *> i(children); while(i.hasNext()) { c = i.next(); if(c->type() == RTNT_ITEM) { RosterItem *item = static_cast<RosterItem *>(c); if(item->getJID() == jid) return item; } else if(c->type() == RTNT_GROUP) { RosterItem *i = static_cast<RosterGroup *>(c)->get_item(jid); if(i) return i; } } return 0; }