diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2016-04-12 19:24:49 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2016-05-02 19:22:45 +0900 |
commit | abfdceda30179c7e7f6fcd72bcb994ee4a9bba5e (patch) | |
tree | f837cad919b364cdf89d3dfe0f752cada4c58e10 /room.cpp | |
parent | 32b055f56287e97d84a4431a36909027991ef1fc (diff) | |
download | libquotient-abfdceda30179c7e7f6fcd72bcb994ee4a9bba5e.tar.gz libquotient-abfdceda30179c7e7f6fcd72bcb994ee4a9bba5e.zip |
Mark read-only accessors in Room::Private as const.
Diffstat (limited to 'room.cpp')
-rw-r--r-- | room.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -73,9 +73,9 @@ class Room::Private: public QObject // operation. //void inviteUser(User* u); // We might get it at some point in time. void addMember(User* u); - bool hasMember(User* u); + bool hasMember(User* u) const; // You can't identify a single user by displayname, only by id - User* member(QString id); + User* member(QString id) const; void renameMember(User* u, QString oldName); void removeMember(User* u); }; @@ -229,12 +229,12 @@ void Room::Private::addMember(User *u) } } -bool Room::Private::hasMember(User* u) +bool Room::Private::hasMember(User* u) const { return membersMap.values(u->name()).contains(u); } -User* Room::Private::member(QString id) +User* Room::Private::member(QString id) const { User* u = connection->user(id); return hasMember(u) ? u : nullptr; |