diff options
-rw-r--r-- | dummyresource/CMakeLists.txt | 11 | ||||
-rw-r--r-- | dummyresource/resourcefactory.cpp | 44 | ||||
-rw-r--r-- | dummyresource/resourcefactory.h | 45 | ||||
-rw-r--r-- | dummyresource/syncronizer.cpp | 0 |
4 files changed, 93 insertions, 7 deletions
diff --git a/dummyresource/CMakeLists.txt b/dummyresource/CMakeLists.txt index e03fd4c..2729466 100644 --- a/dummyresource/CMakeLists.txt +++ b/dummyresource/CMakeLists.txt | |||
@@ -1,15 +1,12 @@ | |||
1 | project(akonadi2_resource_dummy) | 1 | project(akonadi2_resource_dummy) |
2 | 2 | ||
3 | add_definitions(-DQT_PLUGIN) | ||
3 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) | 4 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) |
4 | 5 | ||
5 | generate_flatbuffers(dummycalendar) | 6 | generate_flatbuffers(dummycalendar) |
6 | 7 | ||
7 | #Client plugin | 8 | add_library(${PROJECT_NAME} SHARED facade.cpp resourcefactory.cpp) |
8 | add_library(${PROJECT_NAME} SHARED facade.cpp) | ||
9 | target_link_libraries(${PROJECT_NAME} akonadi2common) | ||
10 | qt5_use_modules(${PROJECT_NAME} Core) | 9 | qt5_use_modules(${PROJECT_NAME} Core) |
11 | #install(TARGETS ${PROJECT_NAME} DESTINATION lib) | 10 | target_link_libraries(${PROJECT_NAME} akonadi2common) |
12 | |||
13 | #Syncronizer | ||
14 | 11 | ||
15 | #add_subdirectory(test) | 12 | install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${AKONADI2_RESOURCE_PLUGINS_PATH}) |
diff --git a/dummyresource/resourcefactory.cpp b/dummyresource/resourcefactory.cpp new file mode 100644 index 0000000..2d89c77 --- /dev/null +++ b/dummyresource/resourcefactory.cpp | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014 Aaron Seigo <aseigo@kde.org> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
18 | */ | ||
19 | |||
20 | #include "resourcefactory.h" | ||
21 | #include "facade.h" | ||
22 | |||
23 | DummyResource::DummyResource() | ||
24 | : Akonadi2::Resource() | ||
25 | { | ||
26 | |||
27 | } | ||
28 | |||
29 | DummyResourceFactory::DummyResourceFactory(QObject *parent) | ||
30 | : Akonadi2::ResourceFactory(parent) | ||
31 | { | ||
32 | |||
33 | } | ||
34 | |||
35 | Akonadi2::Resource *DummyResourceFactory::createResource() | ||
36 | { | ||
37 | return new DummyResource(); | ||
38 | } | ||
39 | |||
40 | void DummyResourceFactory::registerFacades(Akonadi2::FacadeFactory &factory) | ||
41 | { | ||
42 | factory.registerFacade<Akonadi2::Domain::Event, DummyResourceFacade>(PLUGIN_NAME); | ||
43 | } | ||
44 | |||
diff --git a/dummyresource/resourcefactory.h b/dummyresource/resourcefactory.h new file mode 100644 index 0000000..2e5708e --- /dev/null +++ b/dummyresource/resourcefactory.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014 Aaron Seigo <aseigo@kde.org> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
18 | */ | ||
19 | |||
20 | #pragma once | ||
21 | |||
22 | #include "common/resource.h" | ||
23 | |||
24 | //TODO: a little ugly to have this in two places, once here and once in Q_PLUGIN_METADATA | ||
25 | #define PLUGIN_NAME "org.kde.dummy" | ||
26 | |||
27 | class DummyResource : public Akonadi2::Resource | ||
28 | { | ||
29 | public: | ||
30 | DummyResource(); | ||
31 | }; | ||
32 | |||
33 | class DummyResourceFactory : public Akonadi2::ResourceFactory | ||
34 | { | ||
35 | Q_OBJECT | ||
36 | Q_PLUGIN_METADATA(IID "org.kde.dummy") | ||
37 | Q_INTERFACES(Akonadi2::ResourceFactory) | ||
38 | |||
39 | public: | ||
40 | DummyResourceFactory(QObject *parent = 0); | ||
41 | |||
42 | Akonadi2::Resource *createResource(); | ||
43 | void registerFacades(Akonadi2::FacadeFactory &factory); | ||
44 | }; | ||
45 | |||
diff --git a/dummyresource/syncronizer.cpp b/dummyresource/syncronizer.cpp deleted file mode 100644 index e69de29..0000000 --- a/dummyresource/syncronizer.cpp +++ /dev/null | |||