summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Seigo <aseigo@kde.org>2014-12-16 10:02:48 +0100
committerAaron Seigo <aseigo@kde.org>2014-12-16 10:02:48 +0100
commitd16e1d88434e321d23257b18abcd572587a35efb (patch)
treeae9d8146745acc439799c0826fea33c3b6cbb89f
parent8f17873f9fc8139f8c0ddcb448496b2fefbc59b1 (diff)
downloadsink-d16e1d88434e321d23257b18abcd572587a35efb.tar.gz
sink-d16e1d88434e321d23257b18abcd572587a35efb.zip
dummy resource factory plugin
-rw-r--r--dummyresource/CMakeLists.txt11
-rw-r--r--dummyresource/resourcefactory.cpp44
-rw-r--r--dummyresource/resourcefactory.h45
-rw-r--r--dummyresource/syncronizer.cpp0
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 @@
1project(akonadi2_resource_dummy) 1project(akonadi2_resource_dummy)
2 2
3add_definitions(-DQT_PLUGIN)
3include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 4include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
4 5
5generate_flatbuffers(dummycalendar) 6generate_flatbuffers(dummycalendar)
6 7
7#Client plugin 8add_library(${PROJECT_NAME} SHARED facade.cpp resourcefactory.cpp)
8add_library(${PROJECT_NAME} SHARED facade.cpp)
9target_link_libraries(${PROJECT_NAME} akonadi2common)
10qt5_use_modules(${PROJECT_NAME} Core) 9qt5_use_modules(${PROJECT_NAME} Core)
11#install(TARGETS ${PROJECT_NAME} DESTINATION lib) 10target_link_libraries(${PROJECT_NAME} akonadi2common)
12
13#Syncronizer
14 11
15#add_subdirectory(test) 12install(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
23DummyResource::DummyResource()
24 : Akonadi2::Resource()
25{
26
27}
28
29DummyResourceFactory::DummyResourceFactory(QObject *parent)
30 : Akonadi2::ResourceFactory(parent)
31{
32
33}
34
35Akonadi2::Resource *DummyResourceFactory::createResource()
36{
37 return new DummyResource();
38}
39
40void 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
27class DummyResource : public Akonadi2::Resource
28{
29public:
30 DummyResource();
31};
32
33class DummyResourceFactory : public Akonadi2::ResourceFactory
34{
35 Q_OBJECT
36 Q_PLUGIN_METADATA(IID "org.kde.dummy")
37 Q_INTERFACES(Akonadi2::ResourceFactory)
38
39public:
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