From 02e69f585d489b413b57d6d5b1abcdc5b04d4371 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 13 Sep 2017 14:25:10 +0200 Subject: Reduce the number of progress notifications for large sync sets. We don't need an update for every mail if we download 50k mails. We just need enough to animate a progress bar. --- common/synchronizer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/synchronizer.cpp b/common/synchronizer.cpp index 46d3980..959cf48 100644 --- a/common/synchronizer.cpp +++ b/common/synchronizer.cpp @@ -318,6 +318,10 @@ void Synchronizer::emitProgressNotification(Notification::NoticationType type, i void Synchronizer::reportProgress(int progress, int total, const QByteArrayList &entities) { if (progress > 0 && total > 0) { + //Limit progress updates for large amounts + if (total >= 100 && progress % 10 != 0) { + return; + } SinkLogCtx(mLogCtx) << "Progress: " << progress << " out of " << total << mCurrentRequest.requestId << mCurrentRequest.applicableEntities; const auto applicableEntities = [&] { if (entities.isEmpty()) { -- cgit v1.2.3