diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-21 14:12:14 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-21 14:12:14 +0100 |
commit | daf96f7efec0538e161eab8e906a291015842e1e (patch) | |
tree | 577af79efecd96e0d2187d495628d9950f2a9d45 /examples/davresource | |
parent | 7a98c9853726ed09abd35a447f9854c5459a855d (diff) | |
download | sink-daf96f7efec0538e161eab8e906a291015842e1e.tar.gz sink-daf96f7efec0538e161eab8e906a291015842e1e.zip |
Default domain adaptor
Diffstat (limited to 'examples/davresource')
-rw-r--r-- | examples/davresource/CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/davresource/davresource.cpp | 4 | ||||
-rw-r--r-- | examples/davresource/domainadaptor.cpp | 35 | ||||
-rw-r--r-- | examples/davresource/domainadaptor.h | 38 |
4 files changed, 3 insertions, 76 deletions
diff --git a/examples/davresource/CMakeLists.txt b/examples/davresource/CMakeLists.txt index 9f134c2..28829d5 100644 --- a/examples/davresource/CMakeLists.txt +++ b/examples/davresource/CMakeLists.txt | |||
@@ -5,7 +5,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) | |||
5 | 5 | ||
6 | find_package(KPimKDAV REQUIRED) | 6 | find_package(KPimKDAV REQUIRED) |
7 | 7 | ||
8 | add_library(${PROJECT_NAME} SHARED davresource.cpp domainadaptor.cpp) | 8 | add_library(${PROJECT_NAME} SHARED davresource.cpp) |
9 | qt5_use_modules(${PROJECT_NAME} Core Network) | 9 | qt5_use_modules(${PROJECT_NAME} Core Network) |
10 | target_link_libraries(${PROJECT_NAME} sink KPim::KDAV) | 10 | target_link_libraries(${PROJECT_NAME} sink KPim::KDAV) |
11 | 11 | ||
diff --git a/examples/davresource/davresource.cpp b/examples/davresource/davresource.cpp index d116397..d7254b4 100644 --- a/examples/davresource/davresource.cpp +++ b/examples/davresource/davresource.cpp | |||
@@ -277,8 +277,8 @@ void DavResourceFactory::registerFacades(const QByteArray &name, Sink::FacadeFac | |||
277 | 277 | ||
278 | void DavResourceFactory::registerAdaptorFactories(const QByteArray &name, Sink::AdaptorFactoryRegistry ®istry) | 278 | void DavResourceFactory::registerAdaptorFactories(const QByteArray &name, Sink::AdaptorFactoryRegistry ®istry) |
279 | { | 279 | { |
280 | registry.registerFactory<Sink::ApplicationDomain::Contact, ContactAdaptorFactory>(name); | 280 | registry.registerFactory<ApplicationDomain::Contact, DefaultAdaptorFactory<ApplicationDomain::Contact>>(name); |
281 | registry.registerFactory<Sink::ApplicationDomain::Addressbook, AddressbookAdaptorFactory>(name); | 281 | registry.registerFactory<ApplicationDomain::Addressbook, DefaultAdaptorFactory<ApplicationDomain::Addressbook>>(name); |
282 | } | 282 | } |
283 | 283 | ||
284 | void DavResourceFactory::removeDataFromDisk(const QByteArray &instanceIdentifier) | 284 | void DavResourceFactory::removeDataFromDisk(const QByteArray &instanceIdentifier) |
diff --git a/examples/davresource/domainadaptor.cpp b/examples/davresource/domainadaptor.cpp deleted file mode 100644 index 861a10e..0000000 --- a/examples/davresource/domainadaptor.cpp +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2015 Christian Mollekopf <chrigi_1@fastmail.fm> | ||
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 "domainadaptor.h" | ||
21 | |||
22 | using namespace flatbuffers; | ||
23 | |||
24 | ContactAdaptorFactory::ContactAdaptorFactory() | ||
25 | : DomainTypeAdaptorFactory() | ||
26 | { | ||
27 | |||
28 | } | ||
29 | |||
30 | AddressbookAdaptorFactory::AddressbookAdaptorFactory() | ||
31 | : DomainTypeAdaptorFactory() | ||
32 | { | ||
33 | |||
34 | } | ||
35 | |||
diff --git a/examples/davresource/domainadaptor.h b/examples/davresource/domainadaptor.h deleted file mode 100644 index 7e3c723..0000000 --- a/examples/davresource/domainadaptor.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2015 Christian Mollekopf <chrigi_1@fastmail.fm> | ||
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 | #pragma once | ||
20 | |||
21 | #include <common/domainadaptor.h> | ||
22 | #include "contact_generated.h" | ||
23 | #include "folder_generated.h" | ||
24 | #include "dummy_generated.h" | ||
25 | |||
26 | class ContactAdaptorFactory : public DomainTypeAdaptorFactory<Sink::ApplicationDomain::Contact, Sink::ApplicationDomain::Buffer::Dummy, Sink::ApplicationDomain::Buffer::DummyBuilder> | ||
27 | { | ||
28 | public: | ||
29 | ContactAdaptorFactory(); | ||
30 | virtual ~ContactAdaptorFactory() {}; | ||
31 | }; | ||
32 | |||
33 | class AddressbookAdaptorFactory : public DomainTypeAdaptorFactory<Sink::ApplicationDomain::Folder, Sink::ApplicationDomain::Buffer::Dummy, Sink::ApplicationDomain::Buffer::DummyBuilder> | ||
34 | { | ||
35 | public: | ||
36 | AddressbookAdaptorFactory(); | ||
37 | virtual ~AddressbookAdaptorFactory() {}; | ||
38 | }; | ||