author | wazlaf <wazlaf> | 2002-09-10 23:12:17 (UTC) |
---|---|---|
committer | wazlaf <wazlaf> | 2002-09-10 23:12:17 (UTC) |
commit | d478be344e2ba383a1e38d2a1705de1cdbe2e838 (patch) (unidiff) | |
tree | 9daf7b496c74c695ed8bd72a6ccd321f770b043c /noncore/net/opieirc/ircchannellist.cpp | |
parent | 2d6c8bd7290b766c31c100cd2d66ef0d1d0c407c (diff) | |
download | opie-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) (show whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircchannellist.cpp | 37 |
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 @@ | |||
1 | #include <qpe/resource.h> | ||
2 | #include <qpixmap.h> | ||
3 | #include "ircchannellist.h" | ||
4 | |||
5 | IRCChannelList::IRCChannelList(IRCChannel *channel, QWidget *parent, const char *name, WFlags f) : QListBox(parent, name, f) { | ||
6 | m_channel = channel; | ||
7 | } | ||
8 | |||
9 | void IRCChannelList::update() { | ||
10 | QPixmap op = Resource::loadPixmap("opieirc/op"); | ||
11 | QPixmap hop = Resource::loadPixmap("opieirc/hop"); | ||
12 | QPixmap voice = Resource::loadPixmap("opieirc/voice"); | ||
13 | QListIterator<IRCChannelPerson> it = m_channel->people(); | ||
14 | clear(); | ||
15 | for (; it.current(); ++it) { | ||
16 | IRCChannelPerson *person = it.current(); | ||
17 | if (person->flags & PERSON_FLAG_OP) { | ||
18 | insertItem(op, person->person->nick()); | ||
19 | } else if (person->flags & PERSON_FLAG_HALFOP) { | ||
20 | insertItem(op, person->person->nick()); | ||
21 | } else if (person->flags & PERSON_FLAG_VOICE) { | ||
22 | insertItem(voice, person->person->nick()); | ||
23 | } else { | ||
24 | insertItem(person->person->nick()); | ||
25 | } | ||
26 | } | ||
27 | sort(); | ||
28 | } | ||
29 | |||
30 | |||
31 | bool IRCChannelList::hasPerson(QString nick) { | ||
32 | for (unsigned int i=0; i<count(); i++) { | ||
33 | if (text(i) == nick) | ||
34 | return TRUE; | ||
35 | } | ||
36 | return FALSE; | ||
37 | } | ||