added option to ignore unregistered users in chat; switched UserList data storage to QMap to speed up lookups; issue #28 fixed

This commit is contained in:
Max-Wilhelm Bruker 2012-03-31 15:06:47 +02:00
parent ff632911f2
commit cdda3f15a0
10 changed files with 191 additions and 43 deletions

View file

@ -48,6 +48,8 @@ public:
class UserListTWI : public QTreeWidgetItem {
public:
UserListTWI();
QString getUserName() const;
int getUserLevel() const;
bool operator<(const QTreeWidgetItem &other) const;
};
@ -56,6 +58,7 @@ class UserList : public QGroupBox {
public:
enum UserListType { AllUsersList, RoomList, BuddyList, IgnoreList };
private:
QMap<QString, UserListTWI *> users;
TabSupervisor *tabSupervisor;
AbstractClient *client;
UserListType type;
@ -82,7 +85,7 @@ public:
void processUserInfo(const ServerInfo_User &user, bool online);
bool deleteUser(const QString &userName);
void setUserOnline(const QString &userName, bool online);
bool userInList(const QString &userName) const;
const QMap<QString, UserListTWI *> &getUsers() const { return users; }
void showContextMenu(const QPoint &pos, const QModelIndex &index);
void sortItems();
};