diff options
-rw-r--r-- | common/domain/typeimplementations.cpp | 7 | ||||
-rw-r--r-- | 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<Folder, | |||
56 | > FolderIndexConfig; | 56 | > FolderIndexConfig; |
57 | 57 | ||
58 | typedef IndexConfig<Contact, | 58 | typedef IndexConfig<Contact, |
59 | ValueIndex<Contact::Uid> | 59 | ValueIndex<Contact::Uid>, |
60 | ValueIndex<Contact::Addressbook> | ||
60 | > ContactIndexConfig; | 61 | > ContactIndexConfig; |
61 | 62 | ||
62 | typedef IndexConfig<Addressbook, | 63 | typedef IndexConfig<Addressbook, |
@@ -65,12 +66,14 @@ typedef IndexConfig<Addressbook, | |||
65 | 66 | ||
66 | typedef IndexConfig<Event, | 67 | typedef IndexConfig<Event, |
67 | ValueIndex<Event::Uid>, | 68 | ValueIndex<Event::Uid>, |
69 | ValueIndex<Event::Calendar>, | ||
68 | SortedIndex<Event::StartTime>, | 70 | SortedIndex<Event::StartTime>, |
69 | SampledPeriodIndex<Event::StartTime, Event::EndTime> | 71 | SampledPeriodIndex<Event::StartTime, Event::EndTime> |
70 | > EventIndexConfig; | 72 | > EventIndexConfig; |
71 | 73 | ||
72 | typedef IndexConfig<Todo, | 74 | typedef IndexConfig<Todo, |
73 | ValueIndex<Todo::Uid> | 75 | ValueIndex<Todo::Uid>, |
76 | ValueIndex<Todo::Calendar> | ||
74 | > TodoIndexConfig; | 77 | > TodoIndexConfig; |
75 | 78 | ||
76 | typedef IndexConfig<Calendar, | 79 | typedef IndexConfig<Calendar, |
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<void> WebDavSynchronizer::synchronizeWithSource(const Sink::QueryBas | |||
157 | return KAsync::null<void>(); | 157 | return KAsync::null<void>(); |
158 | } | 158 | } |
159 | 159 | ||
160 | SinkTrace() << "Syncing collection:" << collectionResourceID; | 160 | SinkTrace() << "Syncing collection:" << collectionResourceID << collection.displayName(); |
161 | auto itemsResourceIDs = QSharedPointer<QSet<QByteArray>>::create(); | 161 | auto itemsResourceIDs = QSharedPointer<QSet<QByteArray>>::create(); |
162 | return synchronizeCollection(collection, progress, total, itemsResourceIDs) | 162 | return synchronizeCollection(collection, progress, total, itemsResourceIDs) |
163 | .then([=] { | 163 | .then([=] { |
164 | scanForRemovals(mEntityType, [&itemsResourceIDs](const QByteArray &remoteId) { | 164 | const auto collectionLocalId = collectionLocalResourceID(collection); |
165 | return itemsResourceIDs->contains(remoteId); | 165 | scanForRemovals(mEntityType, |
166 | }); | 166 | [&](const std::function<void(const QByteArray &)> &callback) { |
167 | //FIXME: The collection type just happens to have the same name as the parent collection property | ||
168 | const auto collectionProperty = mCollectionType; | ||
169 | store().indexLookup(mEntityType, collectionProperty, collectionLocalId, callback); | ||
170 | }, | ||
171 | [&itemsResourceIDs](const QByteArray &remoteId) { | ||
172 | return itemsResourceIDs->contains(remoteId); | ||
173 | }); | ||
167 | }); | 174 | }); |
168 | }) | 175 | }) |
169 | .then([=]() { | 176 | .then([=]() { |