From e7ddc02bce5b4e46b44e3cb39c06ed25dc291c0a Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 19 Jan 2016 09:52:40 +0100 Subject: Prepared maildir inspection implementation --- common/clientapi.h | 21 +-------------------- common/inspection.h | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ common/resourcefacade.h | 5 +++++ 3 files changed, 56 insertions(+), 20 deletions(-) create mode 100644 common/inspection.h (limited to 'common') diff --git a/common/clientapi.h b/common/clientapi.h index 5ed99e0..14caa7a 100644 --- a/common/clientapi.h +++ b/common/clientapi.h @@ -26,6 +26,7 @@ #include #include "query.h" +#include "inspection.h" #include "applicationdomaintype.h" class QAbstractItemModel; @@ -114,26 +115,6 @@ public: }; namespace Resources { - struct Inspection { - static Inspection PropertyInspection(const Akonadi2::ApplicationDomain::Entity &entity, const QByteArray &property, const QVariant &expectedValue) - { - Inspection inspection; - inspection.resourceIdentifier = entity.resourceInstanceIdentifier(); - inspection.entityIdentifier = entity.identifier(); - inspection.property = property; - inspection.expectedValue = expectedValue; - return inspection; - } - - enum Type { - PropertyInspectionType - }; - - QByteArray resourceIdentifier; - QByteArray entityIdentifier; - QByteArray property; - QVariant expectedValue; - }; template KAsync::Job inspect(const Inspection &inspectionCommand); } diff --git a/common/inspection.h b/common/inspection.h new file mode 100644 index 0000000..45d599a --- /dev/null +++ b/common/inspection.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2015 Christian Mollekopf + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ +#pragma once + +#include +#include +#include "applicationdomaintype.h" + +namespace Akonadi2 { + namespace Resources { + +struct Inspection { + static Inspection PropertyInspection(const Akonadi2::ApplicationDomain::Entity &entity, const QByteArray &property, const QVariant &expectedValue) + { + Inspection inspection; + inspection.resourceIdentifier = entity.resourceInstanceIdentifier(); + inspection.entityIdentifier = entity.identifier(); + inspection.property = property; + inspection.expectedValue = expectedValue; + return inspection; + } + + enum Type { + PropertyInspectionType + }; + QByteArray resourceIdentifier; + QByteArray entityIdentifier; + QByteArray property; + QVariant expectedValue; +}; + + } +} diff --git a/common/resourcefacade.h b/common/resourcefacade.h index 38e0c0e..ae3037a 100644 --- a/common/resourcefacade.h +++ b/common/resourcefacade.h @@ -27,6 +27,7 @@ namespace Akonadi2 { class Query; + class Inspection; } class ResourceFacade : public Akonadi2::StoreFacade @@ -38,5 +39,9 @@ public: KAsync::Job modify(const Akonadi2::ApplicationDomain::AkonadiResource &resource) Q_DECL_OVERRIDE; KAsync::Job remove(const Akonadi2::ApplicationDomain::AkonadiResource &resource) Q_DECL_OVERRIDE; QPair, typename Akonadi2::ResultEmitter::Ptr > load(const Akonadi2::Query &query) Q_DECL_OVERRIDE; + KAsync::Job inspect(const Akonadi2::Inspection &domainObject) Q_DECL_OVERRIDE + { + return KAsync::error(-1, "Failed to inspect."); + } }; -- cgit v1.2.3