From d478be344e2ba383a1e38d2a1705de1cdbe2e838 Mon Sep 17 00:00:00 2001 From: wazlaf Date: Tue, 10 Sep 2002 23:12:17 +0000 Subject: initial import of OpieIRC v0.1 --- (limited to 'noncore/net/opieirc/ircchannellist.cpp') diff --git a/noncore/net/opieirc/ircchannellist.cpp b/noncore/net/opieirc/ircchannellist.cpp new file mode 100644 index 0000000..e592d05 --- a/dev/null +++ b/noncore/net/opieirc/ircchannellist.cpp @@ -0,0 +1,37 @@ +#include +#include +#include "ircchannellist.h" + +IRCChannelList::IRCChannelList(IRCChannel *channel, QWidget *parent, const char *name, WFlags f) : QListBox(parent, name, f) { + m_channel = channel; +} + +void IRCChannelList::update() { + QPixmap op = Resource::loadPixmap("opieirc/op"); + QPixmap hop = Resource::loadPixmap("opieirc/hop"); + QPixmap voice = Resource::loadPixmap("opieirc/voice"); + QListIterator it = m_channel->people(); + clear(); + for (; it.current(); ++it) { + IRCChannelPerson *person = it.current(); + if (person->flags & PERSON_FLAG_OP) { + insertItem(op, person->person->nick()); + } else if (person->flags & PERSON_FLAG_HALFOP) { + insertItem(op, person->person->nick()); + } else if (person->flags & PERSON_FLAG_VOICE) { + insertItem(voice, person->person->nick()); + } else { + insertItem(person->person->nick()); + } + } + sort(); +} + + +bool IRCChannelList::hasPerson(QString nick) { + for (unsigned int i=0; i