diff options
author | Loren Burkholder <computersemiexpert@outlook.com> | 2021-11-13 15:05:26 -0500 |
---|---|---|
committer | Loren Burkholder <computersemiexpert@outlook.com> | 2021-11-16 18:40:48 -0500 |
commit | b1c1274d96144805bf416571117f9889f2e55600 (patch) | |
tree | 386eebaa22102e11f4015ee200f8dfebc49e5afc /src/InviteesModel.cpp | |
parent | Nicer padding (diff) | |
download | nheko-b1c1274d96144805bf416571117f9889f2e55600.tar.xz |
Allow removing users from the invite dialog
Diffstat (limited to 'src/InviteesModel.cpp')
-rw-r--r-- | src/InviteesModel.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/InviteesModel.cpp b/src/InviteesModel.cpp index e045581a..707bfd97 100644 --- a/src/InviteesModel.cpp +++ b/src/InviteesModel.cpp @@ -30,6 +30,20 @@ InviteesModel::addUser(QString mxid) emit countChanged(); } +void +InviteesModel::removeUser(QString mxid) +{ + for (int i = 0; i < invitees_.length(); ++i) { + if (invitees_[i]->mxid_ == mxid) { + beginRemoveRows(QModelIndex(), i, i); + invitees_.removeAt(i); + endRemoveRows(); + emit countChanged(); + break; + } + } +} + QHash<int, QByteArray> InviteesModel::roleNames() const { |