summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircchannellist.cpp
authorwazlaf <wazlaf>2002-09-10 23:12:17 (UTC)
committer wazlaf <wazlaf>2002-09-10 23:12:17 (UTC)
commitd478be344e2ba383a1e38d2a1705de1cdbe2e838 (patch) (side-by-side diff)
tree9daf7b496c74c695ed8bd72a6ccd321f770b043c /noncore/net/opieirc/ircchannellist.cpp
parent2d6c8bd7290b766c31c100cd2d66ef0d1d0c407c (diff)
downloadopie-d478be344e2ba383a1e38d2a1705de1cdbe2e838.zip
opie-d478be344e2ba383a1e38d2a1705de1cdbe2e838.tar.gz
opie-d478be344e2ba383a1e38d2a1705de1cdbe2e838.tar.bz2
initial import of OpieIRC v0.1
Diffstat (limited to 'noncore/net/opieirc/ircchannellist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircchannellist.cpp37
1 files changed, 37 insertions, 0 deletions
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 <qpe/resource.h>
+#include <qpixmap.h>
+#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<IRCChannelPerson> 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<count(); i++) {
+ if (text(i) == nick)
+ return TRUE;
+ }
+ return FALSE;
+}