mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-02 11:33:55 -07:00
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:
parent
ff632911f2
commit
cdda3f15a0
10 changed files with 191 additions and 43 deletions
|
|
@ -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();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue