diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-30 15:35:06 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-30 16:07:54 +0900 |
commit | 038471e340c51f36f612fbb19d8a2b60a9923973 (patch) | |
tree | 64fd4526106f80b6a0091f6c5ad10127e73aec30 /connection.cpp | |
parent | fcb0342410beaacc84c59813a1a7b6195c6abf7f (diff) | |
download | libquotient-038471e340c51f36f612fbb19d8a2b60a9923973.tar.gz libquotient-038471e340c51f36f612fbb19d8a2b60a9923973.zip |
Connection: expose the list of users; use an ordered map
It's still an open question whether it's better to store a separate
sorted index of users, next to an unsorted one; but a sorted list of
users is of much more use in GUI than an unsorted one.
Diffstat (limited to 'connection.cpp')
-rw-r--r-- | connection.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/connection.cpp b/connection.cpp index 01d7461d..e06baef7 100644 --- a/connection.cpp +++ b/connection.cpp @@ -62,7 +62,7 @@ class Connection::Private // Leave state of the same room. QHash<QPair<QString, bool>, Room*> roomMap; QVector<QString> roomIdsToForget; - QHash<QString, User*> userMap; + QMap<QString, User*> userMap; QString userId; SyncJob* syncJob = nullptr; @@ -516,6 +516,11 @@ QHash< QPair<QString, bool>, Room* > Connection::roomMap() const return roomMap; } +QMap<QString, User*> Connection::users() const +{ + return d->userMap; +} + const ConnectionData* Connection::connectionData() const { return d->data.get(); |