From 547e5e29cbfc12474ab45768ff0d9342882b2633 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 28 Mar 2017 09:26:50 +0200 Subject: Track the entities that this request applies to directly in the syncrequest That way we can do the notification emitting in the synchronizer and it keeps working even if the login already fails (so the synchronizing code would never be executed). --- common/synchronizer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common/synchronizer.cpp') diff --git a/common/synchronizer.cpp b/common/synchronizer.cpp index ec896ed..329841b 100644 --- a/common/synchronizer.cpp +++ b/common/synchronizer.cpp @@ -329,7 +329,7 @@ KAsync::Job Synchronizer::processRequest(const SyncRequest &request) return KAsync::start([this, request] { SinkLogCtx(mLogCtx) << "Synchronizing: " << request.query; emitNotification(Notification::Status, ApplicationDomain::BusyStatus, "Synchronization has started.", request.requestId); - emitNotification(Notification::Info, ApplicationDomain::SyncInProgress, {}, {}, request.query.ids()); + emitNotification(Notification::Info, ApplicationDomain::SyncInProgress, {}, {}, request.applicableEntities); }).then(synchronizeWithSource(request.query)).then([this] { //Commit after every request, so implementations only have to commit more if they add a lot of data. commit(); @@ -337,12 +337,12 @@ KAsync::Job Synchronizer::processRequest(const SyncRequest &request) if (error) { //Emit notification with error SinkWarningCtx(mLogCtx) << "Synchronization failed: " << error.errorMessage; - emitNotification(Notification::Warning, ApplicationDomain::SyncError, {}, {}, request.query.ids()); + emitNotification(Notification::Warning, ApplicationDomain::SyncError, {}, {}, request.applicableEntities); emitNotification(Notification::Status, ApplicationDomain::ErrorStatus, "Synchronization has ended.", request.requestId); return KAsync::error(error); } else { SinkLogCtx(mLogCtx) << "Done Synchronizing"; - emitNotification(Notification::Info, ApplicationDomain::SyncSuccess, {}, {}, request.query.ids()); + emitNotification(Notification::Info, ApplicationDomain::SyncSuccess, {}, {}, request.applicableEntities); emitNotification(Notification::Status, ApplicationDomain::ConnectedStatus, "Synchronization has ended.", request.requestId); return KAsync::null(); } -- cgit v1.2.3