author | wimpie <wimpie> | 2005-01-08 15:16:37 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2005-01-08 15:16:37 (UTC) |
commit | 955213d274c2f0c11d0f153e2fed5df5170e50f6 (patch) (side-by-side diff) | |
tree | 5bf19444380a734ae5c184ba83aeb093e6ae4113 /noncore/net/opieirc/ircchannellist.cpp | |
parent | 9acc68823f95f62367813dbb42387ad5ee094aae (diff) | |
download | opie-955213d274c2f0c11d0f153e2fed5df5170e50f6.zip opie-955213d274c2f0c11d0f153e2fed5df5170e50f6.tar.gz opie-955213d274c2f0c11d0f153e2fed5df5170e50f6.tar.bz2 |
Changes in this patch:
*Added some irc numerical codes (253, 422)
*Reordered codes
*Unified some functions which did exactly the same in two functions
*Changed nick ordering in channel list, now nicks get ordered first
by flags and then by name.
Diffstat (limited to 'noncore/net/opieirc/ircchannellist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircchannellist.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/noncore/net/opieirc/ircchannellist.cpp b/noncore/net/opieirc/ircchannellist.cpp index 4e13dee..6bef318 100644 --- a/noncore/net/opieirc/ircchannellist.cpp +++ b/noncore/net/opieirc/ircchannellist.cpp @@ -13,18 +13,19 @@ void IRCChannelList::update() { clear(); for (; it.current(); ++it) { IRCChannelPerson *person = it.current(); if (person->flags & PERSON_FLAG_OP) { - insertItem(op, person->person->nick()); + insertItem(op, "1" + person->person->nick()); } else if (person->flags & PERSON_FLAG_HALFOP) { - insertItem(op, person->person->nick()); + insertItem(op, "2" + person->person->nick()); } else if (person->flags & PERSON_FLAG_VOICE) { - insertItem(voice, person->person->nick()); + insertItem(voice, "3" + person->person->nick()); } else { - insertItem(person->person->nick()); + insertItem("4" + person->person->nick()); } } sort(); + adjustNicks(); } bool IRCChannelList::hasPerson(QString nick) { @@ -44,4 +45,21 @@ bool IRCChannelList::removePerson(QString nick) { } return FALSE; } +void IRCChannelList::adjustNicks() { + QString txt; + QPixmap pm; + + for(unsigned int i=0; i<count(); i++) { + txt = text(i).remove(0,1); + if(pixmap(i)) { + pm = *pixmap(i); + removeItem(i); + insertItem(pm, txt, i); + } + else { + removeItem(i); + insertItem(txt,i); + } + } +} |