From b36bd12519314298befa956f09bc580297edf1b0 Mon Sep 17 00:00:00 2001 From: Matt Vogt Date: Mon, 12 Aug 2013 17:11:09 +1000 Subject: [PATCH] [libcontacts] Report changes to name groups on contact removal --- src/seasidecache.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/seasidecache.cpp b/src/seasidecache.cpp index b7d29be..d5d1d2f 100644 --- a/src/seasidecache.cpp +++ b/src/seasidecache.cpp @@ -828,6 +828,13 @@ void SeasideCache::removeContactData( m_contacts[filter].remove(row); + if (filter == FilterAll) { + QList modifiedNameGroups; + const QChar nameGroup = nameGroupForCacheItem(existingItem(contactId)); + removeFromContactNameGroup(internalId(contactId), nameGroup, &modifiedNameGroups); + notifyNameGroupsChanged(modifiedNameGroups); + } + for (int i = 0; i < models.count(); ++i) models.at(i)->sourceItemsRemoved(); } @@ -1743,8 +1750,7 @@ void SeasideCache::appendContacts(const QList &contacts, FilterType fi for (int i = 0; i < models.count(); ++i) models.at(i)->sourceItemsInserted(begin, end); - if (!m_nameGroupChangeListeners.isEmpty()) - notifyNameGroupsChanged(m_contactNameGroups.keys()); + notifyNameGroupsChanged(m_contactNameGroups.keys()); } } }