contactadapter: invalidate model on modelUpdated

This allow to refresh popup if a contact is added while showing
the element.

Change-Id: I7dfce7a24f0160a0328205d466bd0d4ae626b90f
GitLab: #790
This commit is contained in:
Sébastien Blin
2022-12-19 16:40:35 -05:00
parent c1594e548a
commit 5f7bf66beb

View File

@@ -249,10 +249,20 @@ ContactAdapter::removeContact(const QString& peerUri, bool banContact)
void
ContactAdapter::connectSignals()
{
if (lrcInstance_->getCurrentContactModel())
if (lrcInstance_->getCurrentContactModel()) {
connect(lrcInstance_->getCurrentContactModel(),
&ContactModel::bannedStatusChanged,
this,
&ContactAdapter::bannedStatusChanged,
Qt::UniqueConnection);
connect(
lrcInstance_->getCurrentContactModel(),
&ContactModel::modelUpdated,
this,
[&](const auto& uri) {
// Refresh contacts shown
selectableProxyModel_->invalidate();
},
Qt::UniqueConnection);
}
}