From 86c75f9d7747353045aae9b141da3f8fb08583f9 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 16 Jul 2017 00:26:44 +0200 Subject: Filter resources for syncing by type. Otherwise we end up sending sync requests for contacts to imap resources. --- common/store.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/store.cpp b/common/store.cpp index 4735113..29e826a 100644 --- a/common/store.cpp +++ b/common/store.cpp @@ -311,9 +311,14 @@ KAsync::Job Store::synchronize(const Sink::Query &query) KAsync::Job Store::synchronize(const Sink::SyncScope &scope) { + auto resourceFilter = scope.getResourceFilter(); + //Filter resources by type by default + if (!resourceFilter.propertyFilter.contains(ApplicationDomain::SinkResource::Capabilities::name) && !scope.type().isEmpty()) { + resourceFilter.propertyFilter.insert(ApplicationDomain::SinkResource::Capabilities::name, Query::Comparator{scope.type(), Query::Comparator::Contains}); + } Sink::Query query; - query.setFilter(scope.getResourceFilter()); - SinkLog() << "Synchronizing: " << query; + query.setFilter(resourceFilter); + SinkLog() << "Synchronizing all resource matching: " << query; return fetchAll(query) .template each([scope](const ApplicationDomain::SinkResource::Ptr &resource) -> KAsync::Job { return synchronize(resource->identifier(), scope); -- cgit v1.2.3