diff options
Diffstat (limited to 'common/resourcefacade.cpp')
-rw-r--r-- | common/resourcefacade.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/common/resourcefacade.cpp b/common/resourcefacade.cpp index 367704a..df52538 100644 --- a/common/resourcefacade.cpp +++ b/common/resourcefacade.cpp | |||
@@ -20,6 +20,9 @@ | |||
20 | 20 | ||
21 | #include "resourceconfig.h" | 21 | #include "resourceconfig.h" |
22 | #include "query.h" | 22 | #include "query.h" |
23 | #include "definitions.h" | ||
24 | #include "storage.h" | ||
25 | #include <QDir> | ||
23 | 26 | ||
24 | ResourceFacade::ResourceFacade(const QByteArray &) | 27 | ResourceFacade::ResourceFacade(const QByteArray &) |
25 | : Akonadi2::StoreFacade<Akonadi2::ApplicationDomain::AkonadiResource>() | 28 | : Akonadi2::StoreFacade<Akonadi2::ApplicationDomain::AkonadiResource>() |
@@ -35,8 +38,9 @@ ResourceFacade::~ResourceFacade() | |||
35 | KAsync::Job<void> ResourceFacade::create(const Akonadi2::ApplicationDomain::AkonadiResource &resource) | 38 | KAsync::Job<void> ResourceFacade::create(const Akonadi2::ApplicationDomain::AkonadiResource &resource) |
36 | { | 39 | { |
37 | return KAsync::start<void>([resource, this]() { | 40 | return KAsync::start<void>([resource, this]() { |
38 | const QByteArray identifier = resource.getProperty("identifier").toByteArray(); | ||
39 | const QByteArray type = resource.getProperty("type").toByteArray(); | 41 | const QByteArray type = resource.getProperty("type").toByteArray(); |
42 | //It is currently a requirement that the resource starts with the type | ||
43 | const QByteArray identifier = ResourceConfig::newIdentifier(type); | ||
40 | ResourceConfig::addResource(identifier, type); | 44 | ResourceConfig::addResource(identifier, type); |
41 | auto changedProperties = resource.changedProperties(); | 45 | auto changedProperties = resource.changedProperties(); |
42 | changedProperties.removeOne("identifier"); | 46 | changedProperties.removeOne("identifier"); |
@@ -57,7 +61,7 @@ KAsync::Job<void> ResourceFacade::modify(const Akonadi2::ApplicationDomain::Akon | |||
57 | return KAsync::start<void>([resource, this]() { | 61 | return KAsync::start<void>([resource, this]() { |
58 | const QByteArray identifier = resource.identifier(); | 62 | const QByteArray identifier = resource.identifier(); |
59 | if (identifier.isEmpty()) { | 63 | if (identifier.isEmpty()) { |
60 | Warning() << "We need an \"identifier\" property to identify the resource to configure"; | 64 | Warning() << "We need an \"identifier\" property to identify the resource to configure."; |
61 | return; | 65 | return; |
62 | } | 66 | } |
63 | auto changedProperties = resource.changedProperties(); | 67 | auto changedProperties = resource.changedProperties(); |