Skip to content
Snippets Groups Projects
Commit 8793d7c5 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Anthony Léonard
Browse files

BannedContactModel: check if entry exists


Sometimes contact method could be added to BannedContactModel twice:
during creating model and from accountModel when receiving
slotContactRemoved.(it happens if account does not have bannedContactModel
yet). This patch fix it by checking if ContactMethod already exists in the
banned contact list.

Change-Id: I514e0301bbc07378ef9f9a5c345db5b49c8e23e0
Reviewed-by: default avatarAnthony Léonard <anthony.leonard@savoirfairelinux.com>
parent e3761e9e
No related branches found
No related tags found
No related merge requests found
......@@ -137,6 +137,8 @@ BannedContactModel::columnCount( const QModelIndex& parent ) const
void
BannedContactModel::add(ContactMethod* cm)
{
if (d_ptr->m_lBanned.contains(cm))
return;
beginInsertRows(QModelIndex(),d_ptr->m_lBanned.size(),d_ptr->m_lBanned.size());
d_ptr->m_lBanned << cm;
endInsertRows();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment