From abfdceda30179c7e7f6fcd72bcb994ee4a9bba5e Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Tue, 12 Apr 2016 19:24:49 +0900 Subject: Mark read-only accessors in Room::Private as const. --- room.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'room.cpp') diff --git a/room.cpp b/room.cpp index b770c85c..bc8aaf1d 100644 --- a/room.cpp +++ b/room.cpp @@ -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; -- cgit v1.2.3