#include #include "ircchannellist.h" #include "ircchannelperson.h" IRCChannelList::IRCChannelList(IRCChannel *channel, QWidget *parent, const char *name, WFlags f) : QListBox(parent, name, f) { m_channel = channel; } void IRCChannelList::update() { QPixmap op = Opie::Core::OResource::loadPixmap( "opieirc/op" ); QPixmap hop = Opie::Core::OResource::loadPixmap( "opieirc/hop" ); QPixmap voice = Opie::Core::OResource::loadPixmap( "opieirc/voice" ); QListIterator it = m_channel->people(); clear(); for (; it.current(); ++it) { IRCChannelPerson *person = it.current(); if (person->flags() & IRCChannelPerson::PERSON_FLAG_OP) { insertItem(op, "1" + person->nick()); } else if (person->flags() & IRCChannelPerson::PERSON_FLAG_HALFOP) { insertItem(op, "2" + person->nick()); } else if (person->flags() & IRCChannelPerson::PERSON_FLAG_VOICE) { insertItem(voice, "3" + person->nick()); } else { insertItem("4" + person->nick()); } } sort(); adjustNicks(); } bool IRCChannelList::hasPerson(QString nick) { for (unsigned int i=0; i