blob: 48de1b021b3b52ab0f0f3dc4f80d28a04d166ca8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#include "clientapi.h"
#include "resourceaccess.h"
#include "commands.h"
namespace async
{
void run(const std::function<void()> &runner) {
//TODO use a job that runs in a thread?
QtConcurrent::run(runner);
};
} // namespace async
namespace Akonadi2
{
namespace ApplicationDomain
{
template<>
QByteArray getTypeName<Event>()
{
return "event";
}
template<>
QByteArray getTypeName<Todo>()
{
return "todo";
}
} // namespace Domain
void Store::shutdown(const QByteArray &identifier)
{
Akonadi2::ResourceAccess resourceAccess(identifier);
//FIXME this starts the resource, just to shut it down again if it's not running in the first place.
resourceAccess.open();
resourceAccess.sendCommand(Akonadi2::Commands::ShutdownCommand).exec().waitForFinished();
}
} // namespace Akonadi2
|