IRCUserList Class Reference

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.
 
bool changeNick (const QString &oldNickname, const QString &newNickname)
 Changes a nickname while preserving user flags.
 
void clear ()
 
bool hasUser (const QString &nickname) const
 
const IRCUserInfooperator[] (int index) const
 
bool removeNameFromCachedList (const QString &nickname)
 Removes a name from the sortecd cachedNames list.
 
void setUserModes (const QString &nickname, const QList< char > &modes)
 
unsigned size () const
 
QStringList toStringList () const
 Returns all prefixed nicknames in a string list.
 
const IRCUserInfouser (const QString &nickname) const
 
IRCUserInfo userCopy (const QString &nickname) const
 Gets a copy of the IRCUserInfo for user with given name.
 

Detailed Description

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.

Member Function Documentation

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.

Returns
True if name was actually added to the list. False if duplicate names were detected.

Definition at line 31 of file ircuserlist.cpp.

bool IRCUserList::changeNick ( const QString &  oldNickname,
const QString &  newNickname 
)

Changes a nickname while preserving user flags.

Returns
True if oldNickname was found on this list.

Definition at line 47 of file ircuserlist.cpp.

bool IRCUserList::removeNameFromCachedList ( const QString &  nickname)

Removes a name from the sortecd cachedNames list.

Returns
True if the name was actually removed, false otherwise.

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.


The documentation for this class was generated from the following files: