diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-25 19:45:08 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-25 19:45:57 +0900 |
commit | 3a913f33853c675a1051460bc36278be20a4c941 (patch) | |
tree | 6ce4870f8d9f231541f8adffd74ec417f1a1f4fd /room.cpp | |
parent | 8590054a675bc5d2b07fff1acbb084d67c068113 (diff) | |
download | libquotient-3a913f33853c675a1051460bc36278be20a4c941.tar.gz libquotient-3a913f33853c675a1051460bc36278be20a4c941.zip |
Room, User: const-tighten up the code, set QObject names
To make debugging (including QML debugging) more convenient.
Diffstat (limited to 'room.cpp')
-rw-r--r-- | room.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -213,6 +213,7 @@ RoomEventPtr TimelineItem::replaceEvent(RoomEventPtr&& other) Room::Room(Connection* connection, QString id, JoinState initialJoinState) : QObject(connection), d(new Private(connection, id, initialJoinState)) { + setObjectName(id); // See "Accessing the Public Class" section in // https://marcmutz.wordpress.com/translated-articles/pimp-my-pimpl-%E2%80%94-reloaded/ d->q = this; @@ -757,7 +758,7 @@ void Room::Private::removeMember(User* u) } } -QString Room::roomMembername(User *u) const +QString Room::roomMembername(const User* u) const { // See the CS spec, section 11.2.2.3 @@ -1239,6 +1240,7 @@ void Room::processStateEvents(const RoomEvents& events) case EventType::RoomCanonicalAlias: { auto aliasEvent = static_cast<RoomCanonicalAliasEvent*>(event); d->canonicalAlias = aliasEvent->alias(); + setObjectName(d->canonicalAlias); qCDebug(MAIN) << "Room canonical alias updated:" << d->canonicalAlias; emitNamesChanged = true; break; |