Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Commit

Permalink
Merge pull request #51 from mbrasser-jolla/master
Browse files Browse the repository at this point in the history
[libcontacts] Name grouper fixes.
  • Loading branch information
matthewvogt committed Oct 22, 2013
2 parents 25a83ac + 7faaae0 commit 6aa4886
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/seasidecache.cpp
Expand Up @@ -583,13 +583,9 @@ void SeasideCache::setNameGrouper(SeasideNameGrouper *grouper)
new SeasideCache;
instancePtr->m_nameGrouper.reset(grouper);

allContactNameGroups = getAllContactNameGroups();
QStringList groups = instancePtr->m_nameGrouper->allNameGroups();
for (int i = groups.count() - 1; i > -1; --i) {
const QString &group = groups.at(i);
if (!allContactNameGroups.contains(group))
allContactNameGroups.prepend(group);
}
allContactNameGroups = instancePtr->m_nameGrouper->allNameGroups();
if (!allContactNameGroups.contains(QLatin1String("#")))
allContactNameGroups << QLatin1String("#");
}

QString SeasideCache::nameGroup(const CacheItem *cacheItem)
Expand All @@ -607,7 +603,7 @@ QString SeasideCache::determineNameGroup(const CacheItem *cacheItem)

if (!instancePtr->m_nameGrouper.isNull()) {
QString group = instancePtr->m_nameGrouper->nameGroupForContact(cacheItem->contact, instancePtr->m_groupProperty);
if (!group.isNull()) {
if (!group.isNull() && allContactNameGroups.contains(group)) {
return group;
}
}
Expand Down

0 comments on commit 6aa4886

Please sign in to comment.