From c26420604b71da2f32bb29dc531e779656d77fc1 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 19 Dec 2015 17:00:16 +0100 Subject: Make the akonadi2_client more generic One syntax for all entity types and a generic mechanism to execute operations. --- common/resourcefacade.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/resourcefacade.cpp b/common/resourcefacade.cpp index 89d072c..367704a 100644 --- a/common/resourcefacade.cpp +++ b/common/resourcefacade.cpp @@ -55,7 +55,7 @@ KAsync::Job ResourceFacade::create(const Akonadi2::ApplicationDomain::Akon KAsync::Job ResourceFacade::modify(const Akonadi2::ApplicationDomain::AkonadiResource &resource) { return KAsync::start([resource, this]() { - const QByteArray identifier = resource.getProperty("identifier").toByteArray(); + const QByteArray identifier = resource.identifier(); if (identifier.isEmpty()) { Warning() << "We need an \"identifier\" property to identify the resource to configure"; return; @@ -77,7 +77,11 @@ KAsync::Job ResourceFacade::modify(const Akonadi2::ApplicationDomain::Akon KAsync::Job ResourceFacade::remove(const Akonadi2::ApplicationDomain::AkonadiResource &resource) { return KAsync::start([resource, this]() { - const QByteArray identifier = resource.getProperty("identifier").toByteArray(); + const QByteArray identifier = resource.identifier(); + if (identifier.isEmpty()) { + Warning() << "We need an \"identifier\" property to identify the resource to configure"; + return; + } ResourceConfig::removeResource(identifier); }); } @@ -96,7 +100,6 @@ QPair, typename Akonadi2::ResultEmitter::create()); - resource->setProperty("identifier", res); resource->setProperty("type", type); resultProvider->add(resource); } -- cgit v1.2.3