From 7c4b023c09a041c199af1a2ded9b1f2a75a857b9 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 17 Aug 2018 21:52:49 +0200 Subject: Fixed carddav sync --- common/domain/typeimplementations.cpp | 7 +++++-- examples/webdavcommon/webdav.cpp | 15 +++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/common/domain/typeimplementations.cpp b/common/domain/typeimplementations.cpp index bb3f455..aedf889 100644 --- a/common/domain/typeimplementations.cpp +++ b/common/domain/typeimplementations.cpp @@ -56,7 +56,8 @@ typedef IndexConfig FolderIndexConfig; typedef IndexConfig + ValueIndex, + ValueIndex > ContactIndexConfig; typedef IndexConfig, + ValueIndex, SortedIndex, SampledPeriodIndex > EventIndexConfig; typedef IndexConfig + ValueIndex, + ValueIndex > TodoIndexConfig; typedef IndexConfig WebDavSynchronizer::synchronizeWithSource(const Sink::QueryBas return KAsync::null(); } - SinkTrace() << "Syncing collection:" << collectionResourceID; + SinkTrace() << "Syncing collection:" << collectionResourceID << collection.displayName(); auto itemsResourceIDs = QSharedPointer>::create(); return synchronizeCollection(collection, progress, total, itemsResourceIDs) .then([=] { - scanForRemovals(mEntityType, [&itemsResourceIDs](const QByteArray &remoteId) { - return itemsResourceIDs->contains(remoteId); - }); + const auto collectionLocalId = collectionLocalResourceID(collection); + scanForRemovals(mEntityType, + [&](const std::function &callback) { + //FIXME: The collection type just happens to have the same name as the parent collection property + const auto collectionProperty = mCollectionType; + store().indexLookup(mEntityType, collectionProperty, collectionLocalId, callback); + }, + [&itemsResourceIDs](const QByteArray &remoteId) { + return itemsResourceIDs->contains(remoteId); + }); }); }) .then([=]() { -- cgit v1.2.3