summaryrefslogtreecommitdiffstats
path: root/common/clientapi.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-10-23 09:24:55 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-10-23 09:24:55 +0200
commit88556fa0f4040792aacb2ad1af28b2f61b365448 (patch)
tree49400c2e4cb8c46b048ad126336c2bb6288ab635 /common/clientapi.cpp
parent26c879c241ff3ce207d5ae754818fea1b50bd153 (diff)
downloadsink-88556fa0f4040792aacb2ad1af28b2f61b365448.tar.gz
sink-88556fa0f4040792aacb2ad1af28b2f61b365448.zip
Made headers installable and install headers
Diffstat (limited to 'common/clientapi.cpp')
-rw-r--r--common/clientapi.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/common/clientapi.cpp b/common/clientapi.cpp
index 5edab97..df48c3f 100644
--- a/common/clientapi.cpp
+++ b/common/clientapi.cpp
@@ -5,6 +5,7 @@
5#include "resourcefacade.h" 5#include "resourcefacade.h"
6#include "log.h" 6#include "log.h"
7#include "definitions.h" 7#include "definitions.h"
8#include "resourceconfig.h"
8#include <QtConcurrent/QtConcurrentRun> 9#include <QtConcurrent/QtConcurrentRun>
9#include <QTimer> 10#include <QTimer>
10 11
@@ -31,6 +32,44 @@ namespace async
31namespace Akonadi2 32namespace Akonadi2
32{ 33{
33 34
35QString Store::storageLocation()
36{
37 return Akonadi2::storageLocation();
38}
39
40QByteArray Store::resourceName(const QByteArray &instanceIdentifier)
41{
42 return Akonadi2::resourceName(instanceIdentifier);
43}
44
45QList<QByteArray> Store::getResources(const QList<QByteArray> &resourceFilter, const QByteArray &type)
46{
47 //Return the global resource (signified by an empty name) for types that don't eblong to a specific resource
48 if (type == "akonadiresource") {
49 qWarning() << "Global resource";
50 return QList<QByteArray>() << "";
51 }
52 QList<QByteArray> resources;
53 const auto configuredResources = ResourceConfig::getResources();
54 if (resourceFilter.isEmpty()) {
55 for (const auto &res : configuredResources) {
56 if (configuredResources.value(res) == type) {
57 resources << res;
58 }
59 }
60 } else {
61 for (const auto &res : resourceFilter) {
62 if (configuredResources.contains(res)) {
63 resources << res;
64 } else {
65 qWarning() << "Resource is not existing: " << res;
66 }
67 }
68 }
69 qWarning() << "Found resources: " << resources;
70 return resources;
71}
72
34void Store::shutdown(const QByteArray &identifier) 73void Store::shutdown(const QByteArray &identifier)
35{ 74{
36 Trace() << "shutdown"; 75 Trace() << "shutdown";