From 9bab96fcca9dd752c6068ed620cd32adf0f9dae7 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 26 Dec 2015 12:29:49 +0100 Subject: Time sync --- common/listener.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/listener.cpp b/common/listener.cpp index 5468769..1b78f01 100644 --- a/common/listener.cpp +++ b/common/listener.cpp @@ -35,6 +35,7 @@ #include #include #include +#include Listener::Listener(const QByteArray &resourceInstanceIdentifier, QObject *parent) : QObject(parent), @@ -220,6 +221,8 @@ void Listener::processCommand(int commandId, uint messageId, const QByteArray &c if (Akonadi2::VerifySynchronizeBuffer(verifier)) { auto buffer = Akonadi2::GetSynchronize(commandBuffer.constData()); Log() << QString("\tSynchronize request (id %1) from %2").arg(messageId).arg(client.name); + auto timer = QSharedPointer::create(); + timer->start(); auto job = KAsync::null(); if (buffer->sourceSync()) { job = loadResource()->synchronizeWithSource(); @@ -227,7 +230,8 @@ void Listener::processCommand(int commandId, uint messageId, const QByteArray &c if (buffer->localSync()) { job = job.then(loadResource()->processAllMessages()); } - job.then([callback]() { + job.then([callback, timer]() { + Trace() << "Sync took " << timer->elapsed(); callback(); }).exec(); return; -- cgit v1.2.3