diff options
Diffstat (limited to 'common/clientapi.cpp')
-rw-r--r-- | common/clientapi.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/common/clientapi.cpp b/common/clientapi.cpp new file mode 100644 index 0000000..2a4b603 --- /dev/null +++ b/common/clientapi.cpp | |||
@@ -0,0 +1,38 @@ | |||
1 | |||
2 | #include "clientapi.h" | ||
3 | |||
4 | namespace async | ||
5 | { | ||
6 | void run(const std::function<void()> &runner) { | ||
7 | QtConcurrent::run(runner); | ||
8 | |||
9 | // //FIXME we should be using a Job instead of a timer | ||
10 | // auto timer = new QTimer; | ||
11 | // timer->setSingleShot(true); | ||
12 | // QObject::connect(timer, &QTimer::timeout, runner); | ||
13 | // QObject::connect(timer, &QTimer::timeout, timer, &QObject::deleteLater); | ||
14 | // timer->start(0); | ||
15 | }; | ||
16 | } // namespace async | ||
17 | |||
18 | namespace Akonadi2 | ||
19 | { | ||
20 | |||
21 | namespace Domain | ||
22 | { | ||
23 | |||
24 | template<> | ||
25 | QString getTypeName<Event>() | ||
26 | { | ||
27 | return "event"; | ||
28 | } | ||
29 | |||
30 | template<> | ||
31 | QString getTypeName<Todo>() | ||
32 | { | ||
33 | return "todo"; | ||
34 | } | ||
35 | |||
36 | } // namespace Domain | ||
37 | |||
38 | } // namespace Akonadi2 | ||