Allows to perform operation on a list of users. More...
#include <ircuserlist.h>
Public Member Functions | |
bool | appendNameToCachedList (const IRCUserInfo &userInfo) |
Appends a single name to the users array. More... | |
bool | changeNick (const QString &oldNickname, const QString &newNickname) |
Changes a nickname while preserving user flags. More... | |
void | clear () |
bool | hasUser (const QString &nickname) const |
const IRCUserInfo * | operator[] (int index) const |
bool | removeNameFromCachedList (const QString &nickname) |
Removes a name from the sortecd cachedNames list. More... | |
void | setUserModes (const QString &nickname, const QList< char > &modes) |
unsigned | size () const |
QStringList | toStringList () const |
Returns all prefixed nicknames in a string list. More... | |
const IRCUserInfo * | user (const QString &nickname) const |
IRCUserInfo | userCopy (const QString &nickname) const |
Gets a copy of the IRCUserInfo for user with given name. More... | |
Allows to perform operation on a list of users.
This is used to represent users who are present on a channel.
Note: the users array might not be properly sorted. It is up to the views to keep up with changes in this list by capturing signals and ordering nicknames by themselves.
Definition at line 42 of file ircuserlist.h.
bool IRCUserList::appendNameToCachedList | ( | const IRCUserInfo & | userInfo | ) |
Appends a single name to the users array.
Ensures that no duplicate names are found on the list. If a duplicate is found then info is updated.
Definition at line 31 of file ircuserlist.cpp.
bool IRCUserList::changeNick | ( | const QString & | oldNickname, |
const QString & | newNickname | ||
) |
Changes a nickname while preserving user flags.
Definition at line 47 of file ircuserlist.cpp.
bool IRCUserList::removeNameFromCachedList | ( | const QString & | nickname | ) |
Removes a name from the sortecd cachedNames list.
Definition at line 77 of file ircuserlist.cpp.
QStringList IRCUserList::toStringList | ( | ) | const |
Returns all prefixed nicknames in a string list.
Please note that this list is not ordered in any way.
Definition at line 98 of file ircuserlist.cpp.
IRCUserInfo IRCUserList::userCopy | ( | const QString & | nickname | ) | const |
Gets a copy of the IRCUserInfo for user with given name.
If user cannot be found it will return IRCUserInfo with no nickname.
Definition at line 116 of file ircuserlist.cpp.