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 --- examples/webdavcommon/webdav.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'examples/webdavcommon') diff --git a/examples/webdavcommon/webdav.cpp b/examples/webdavcommon/webdav.cpp index ffda34a..0dfb6c0 100644 --- a/examples/webdavcommon/webdav.cpp +++ b/examples/webdavcommon/webdav.cpp @@ -157,13 +157,20 @@ KAsync::Job 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