diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-10 15:08:38 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-10 15:08:38 +0100 |
commit | 5d94d9701b980d84170d0c7b860a3bc469cd8979 (patch) | |
tree | 89ddb34285e6805e4aebb7bcc3a3e309d66fcac2 /common/store.cpp | |
parent | f52fde753064a53652329c86e2b82b5c7d97456e (diff) | |
download | sink-5d94d9701b980d84170d0c7b860a3bc469cd8979.tar.gz sink-5d94d9701b980d84170d0c7b860a3bc469cd8979.zip |
Debug output
Diffstat (limited to 'common/store.cpp')
-rw-r--r-- | common/store.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/common/store.cpp b/common/store.cpp index c461157..7797274 100644 --- a/common/store.cpp +++ b/common/store.cpp | |||
@@ -173,7 +173,7 @@ static std::shared_ptr<StoreFacade<DomainType>> getFacade(const QByteArray &reso | |||
173 | template <class DomainType> | 173 | template <class DomainType> |
174 | KAsync::Job<void> Store::create(const DomainType &domainObject) | 174 | KAsync::Job<void> Store::create(const DomainType &domainObject) |
175 | { | 175 | { |
176 | SinkTrace() << "Create: " << domainObject; | 176 | SinkLog() << "Create: " << domainObject; |
177 | // Potentially move to separate thread as well | 177 | // Potentially move to separate thread as well |
178 | auto facade = getFacade<DomainType>(domainObject.resourceInstanceIdentifier()); | 178 | auto facade = getFacade<DomainType>(domainObject.resourceInstanceIdentifier()); |
179 | return facade->create(domainObject).addToContext(std::shared_ptr<void>(facade)).onError([](const KAsync::Error &error) { SinkWarning() << "Failed to create"; }); | 179 | return facade->create(domainObject).addToContext(std::shared_ptr<void>(facade)).onError([](const KAsync::Error &error) { SinkWarning() << "Failed to create"; }); |
@@ -182,7 +182,7 @@ KAsync::Job<void> Store::create(const DomainType &domainObject) | |||
182 | template <class DomainType> | 182 | template <class DomainType> |
183 | KAsync::Job<void> Store::modify(const DomainType &domainObject) | 183 | KAsync::Job<void> Store::modify(const DomainType &domainObject) |
184 | { | 184 | { |
185 | SinkTrace() << "Modify: " << domainObject; | 185 | SinkLog() << "Modify: " << domainObject; |
186 | // Potentially move to separate thread as well | 186 | // Potentially move to separate thread as well |
187 | auto facade = getFacade<DomainType>(domainObject.resourceInstanceIdentifier()); | 187 | auto facade = getFacade<DomainType>(domainObject.resourceInstanceIdentifier()); |
188 | return facade->modify(domainObject).addToContext(std::shared_ptr<void>(facade)).onError([](const KAsync::Error &error) { SinkWarning() << "Failed to modify"; }); | 188 | return facade->modify(domainObject).addToContext(std::shared_ptr<void>(facade)).onError([](const KAsync::Error &error) { SinkWarning() << "Failed to modify"; }); |
@@ -191,7 +191,7 @@ KAsync::Job<void> Store::modify(const DomainType &domainObject) | |||
191 | template <class DomainType> | 191 | template <class DomainType> |
192 | KAsync::Job<void> Store::move(const DomainType &domainObject, const QByteArray &newResource) | 192 | KAsync::Job<void> Store::move(const DomainType &domainObject, const QByteArray &newResource) |
193 | { | 193 | { |
194 | SinkTrace() << "Move: " << domainObject << newResource; | 194 | SinkLog() << "Move: " << domainObject << newResource; |
195 | // Potentially move to separate thread as well | 195 | // Potentially move to separate thread as well |
196 | auto facade = getFacade<DomainType>(domainObject.resourceInstanceIdentifier()); | 196 | auto facade = getFacade<DomainType>(domainObject.resourceInstanceIdentifier()); |
197 | return facade->move(domainObject, newResource).addToContext(std::shared_ptr<void>(facade)).onError([](const KAsync::Error &error) { SinkWarning() << "Failed to move"; }); | 197 | return facade->move(domainObject, newResource).addToContext(std::shared_ptr<void>(facade)).onError([](const KAsync::Error &error) { SinkWarning() << "Failed to move"; }); |
@@ -269,6 +269,7 @@ KAsync::Job<void> Store::synchronize(const Sink::SyncScope &scope) | |||
269 | { | 269 | { |
270 | Sink::Query query; | 270 | Sink::Query query; |
271 | query.setFilter(scope.getResourceFilter()); | 271 | query.setFilter(scope.getResourceFilter()); |
272 | SinkLog() << "Synchronizing: " << query; | ||
272 | return fetchAll<ApplicationDomain::SinkResource>(query) | 273 | return fetchAll<ApplicationDomain::SinkResource>(query) |
273 | .template each([scope](const ApplicationDomain::SinkResource::Ptr &resource) -> KAsync::Job<void> { | 274 | .template each([scope](const ApplicationDomain::SinkResource::Ptr &resource) -> KAsync::Job<void> { |
274 | return synchronize(resource->identifier(), scope); | 275 | return synchronize(resource->identifier(), scope); |