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

Commit

Permalink
Remove superfluous group validity tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewvogt committed Oct 11, 2013
1 parent b28d6f3 commit b0d72c2
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/seasidecache.cpp
Expand Up @@ -883,11 +883,9 @@ void SeasideCache::removeContactData(quint32 iid, FilterType filter)

if (filter == FilterAll) {
const QString group(nameGroup(existingItem(iid)));
if (!group.isNull()) {
QSet<QString> modifiedNameGroups;
removeFromContactNameGroup(iid, group, &modifiedNameGroups);
notifyNameGroupsChanged(modifiedNameGroups);
}
QSet<QString> modifiedNameGroups;
removeFromContactNameGroup(iid, group, &modifiedNameGroups);
notifyNameGroupsChanged(modifiedNameGroups);
}

for (int i = 0; i < models.count(); ++i)
Expand Down Expand Up @@ -1803,9 +1801,7 @@ void SeasideCache::contactsAvailable()
if (item->nameGroup != oldNameGroup) {
if (!ignoreContactForNameGroups(item->contact)) {
addToContactNameGroup(item->iid, item->nameGroup, &modifiedGroups);
if (!oldNameGroup.isNull()) {
removeFromContactNameGroup(item->iid, oldNameGroup, &modifiedGroups);
}
removeFromContactNameGroup(item->iid, oldNameGroup, &modifiedGroups);
}
}

Expand Down Expand Up @@ -2268,9 +2264,7 @@ void SeasideCache::displayLabelOrderChanged()
const QString group(determineNameGroup(&*it));
if (group != it->nameGroup) {
if (!ignoreContactForNameGroups(it->contact)) {
if (!it->nameGroup.isNull()) {
removeFromContactNameGroup(it->iid, it->nameGroup, &modifiedGroups);
}
removeFromContactNameGroup(it->iid, it->nameGroup, &modifiedGroups);

it->nameGroup = group;
addToContactNameGroup(it->iid, it->nameGroup, &modifiedGroups);
Expand Down Expand Up @@ -2345,9 +2339,7 @@ void SeasideCache::groupPropertyChanged()
const QString group(determineNameGroup(&*it));
if (group != it->nameGroup) {
if (!ignoreContactForNameGroups(it->contact)) {
if (!it->nameGroup.isNull()) {
removeFromContactNameGroup(it->iid, it->nameGroup, &modifiedGroups);
}
removeFromContactNameGroup(it->iid, it->nameGroup, &modifiedGroups);

it->nameGroup = group;
addToContactNameGroup(it->iid, it->nameGroup, &modifiedGroups);
Expand Down

0 comments on commit b0d72c2

Please sign in to comment.