From 6aef84109f68e07d71432d5bb8437e33eaeed940 Mon Sep 17 00:00:00 2001 From: Roman Plášil Date: Mon, 13 Feb 2017 09:24:52 +0800 Subject: Add Room::memberNames() for nick completion in QML --- room.cpp | 10 ++++++++++ room.h | 1 + 2 files changed, 11 insertions(+) diff --git a/room.cpp b/room.cpp index 6c22b338..49517ab9 100644 --- a/room.cpp +++ b/room.cpp @@ -370,6 +370,16 @@ QList< User* > Room::users() const return d->membersMap.values(); } +QStringList Room::memberNames() const { + QStringList res; + + for (auto u : d->membersMap.values()) { + res.append( this->roomMembername(u) ); + } + + return res; +} + void Room::Private::insertMemberIntoMap(User *u) { auto namesakes = membersMap.values(u->name()); diff --git a/room.h b/room.h index 4f7a3c97..a847161d 100644 --- a/room.h +++ b/room.h @@ -90,6 +90,7 @@ namespace QMatrixClient QList membersLeft() const; Q_INVOKABLE QList users() const; + Q_INVOKABLE QStringList memberNames() const; /** * @brief Produces a disambiguated name for a given user in -- cgit v1.2.3