From 9aa1cf3fb9bb380f6f069fc539b037bfd3d07030 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 19 Jan 2016 11:47:03 +0100 Subject: ExisteneceInspection --- examples/maildirresource/maildirresource.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'examples') diff --git a/examples/maildirresource/maildirresource.cpp b/examples/maildirresource/maildirresource.cpp index 5d540be..9280bdc 100644 --- a/examples/maildirresource/maildirresource.cpp +++ b/examples/maildirresource/maildirresource.cpp @@ -312,6 +312,12 @@ KAsync::Job MaildirResource::inspect(int inspectionType, const QByteArray return KAsync::null(); } } + if (inspectionType == Akonadi2::Resources::Inspection::ExistenceInspectionType) { + const auto remoteId = resolveLocalId(ENTITY_TYPE_MAIL, entityId, synchronizationTransaction); + if (QFileInfo(remoteId).exists() != expectedValue.toBool()) { + return KAsync::error(1, "Wrong file existence: " + remoteId); + } + } } return KAsync::null(); } -- cgit v1.2.3