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

Commit

Permalink
Browse files Browse the repository at this point in the history
[libcontacts] Also update section bucket index cache during list sync…
…hronisation. Contributes to JB#45836

Batch updates are handled via list synchronisation.  We need to
ensure that we update the section bucket index cache of any model
after a list synchronisation occurs.
  • Loading branch information
Chris Adams committed May 16, 2019
1 parent 80096fb commit 74aa135
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/seasidecache.cpp
Expand Up @@ -2574,8 +2574,10 @@ void SeasideCache::removeRange(FilterType filter, int index, int count)
cacheIds.removeAt(index);
}

for (int i = 0; i < models.count(); ++i)
for (int i = 0; i < models.count(); ++i) {
models[i]->sourceItemsRemoved();
models[i]->updateSectionBucketIndexCache();
}
}

int SeasideCache::insertRange(FilterType filter, int index, int count, const QList<quint32> &queryIds, int queryIndex)
Expand All @@ -2602,8 +2604,10 @@ int SeasideCache::insertRange(FilterType filter, int index, int count, const QLi
cacheIds.insert(index + i, iid);
}

for (int i = 0; i < models.count(); ++i)
for (int i = 0; i < models.count(); ++i) {
models[i]->sourceItemsInserted(index, end);
models[i]->updateSectionBucketIndexCache();
}

return end - index + 1;
}
Expand Down

0 comments on commit 74aa135

Please sign in to comment.