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/imapresource | |
parent | 7a98c9853726ed09abd35a447f9854c5459a855d (diff) | |
download | sink-daf96f7efec0538e161eab8e906a291015842e1e.tar.gz sink-daf96f7efec0538e161eab8e906a291015842e1e.zip |
Default domain adaptor
Diffstat (limited to 'examples/imapresource')
-rw-r--r-- | examples/imapresource/CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/imapresource/domainadaptor.cpp | 35 | ||||
-rw-r--r-- | examples/imapresource/domainadaptor.h | 38 | ||||
-rw-r--r-- | examples/imapresource/imapresource.cpp | 4 |
4 files changed, 3 insertions, 76 deletions
diff --git a/examples/imapresource/CMakeLists.txt b/examples/imapresource/CMakeLists.txt index 61680cd..46a8b08 100644 --- a/examples/imapresource/CMakeLists.txt +++ b/examples/imapresource/CMakeLists.txt | |||
@@ -8,7 +8,7 @@ find_package(KIMAP2 0.0.1 REQUIRED) | |||
8 | 8 | ||
9 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) | 9 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) |
10 | 10 | ||
11 | add_library(${PROJECT_NAME} SHARED imapresource.cpp domainadaptor.cpp imapserverproxy.cpp) | 11 | add_library(${PROJECT_NAME} SHARED imapresource.cpp imapserverproxy.cpp) |
12 | qt5_use_modules(${PROJECT_NAME} Core Network) | 12 | qt5_use_modules(${PROJECT_NAME} Core Network) |
13 | target_link_libraries(${PROJECT_NAME} sink KF5::Mime KIMAP2) | 13 | target_link_libraries(${PROJECT_NAME} sink KF5::Mime KIMAP2) |
14 | 14 | ||
diff --git a/examples/imapresource/domainadaptor.cpp b/examples/imapresource/domainadaptor.cpp deleted file mode 100644 index 4e74ad2..0000000 --- a/examples/imapresource/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 | ImapMailAdaptorFactory::ImapMailAdaptorFactory() | ||
25 | : DomainTypeAdaptorFactory() | ||
26 | { | ||
27 | |||
28 | } | ||
29 | |||
30 | ImapFolderAdaptorFactory::ImapFolderAdaptorFactory() | ||
31 | : DomainTypeAdaptorFactory() | ||
32 | { | ||
33 | |||
34 | } | ||
35 | |||
diff --git a/examples/imapresource/domainadaptor.h b/examples/imapresource/domainadaptor.h deleted file mode 100644 index 06a513c..0000000 --- a/examples/imapresource/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 "mail_generated.h" | ||
23 | #include "folder_generated.h" | ||
24 | #include "dummy_generated.h" | ||
25 | |||
26 | class ImapMailAdaptorFactory : public DomainTypeAdaptorFactory<Sink::ApplicationDomain::Mail, Sink::ApplicationDomain::Buffer::Dummy, Sink::ApplicationDomain::Buffer::DummyBuilder> | ||
27 | { | ||
28 | public: | ||
29 | ImapMailAdaptorFactory(); | ||
30 | virtual ~ImapMailAdaptorFactory() {}; | ||
31 | }; | ||
32 | |||
33 | class ImapFolderAdaptorFactory : public DomainTypeAdaptorFactory<Sink::ApplicationDomain::Folder, Sink::ApplicationDomain::Buffer::Dummy, Sink::ApplicationDomain::Buffer::DummyBuilder> | ||
34 | { | ||
35 | public: | ||
36 | ImapFolderAdaptorFactory(); | ||
37 | virtual ~ImapFolderAdaptorFactory() {}; | ||
38 | }; | ||
diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp index 4f6f748..535a35c 100644 --- a/examples/imapresource/imapresource.cpp +++ b/examples/imapresource/imapresource.cpp | |||
@@ -955,8 +955,8 @@ void ImapResourceFactory::registerFacades(const QByteArray &name, Sink::FacadeFa | |||
955 | 955 | ||
956 | void ImapResourceFactory::registerAdaptorFactories(const QByteArray &name, Sink::AdaptorFactoryRegistry ®istry) | 956 | void ImapResourceFactory::registerAdaptorFactories(const QByteArray &name, Sink::AdaptorFactoryRegistry ®istry) |
957 | { | 957 | { |
958 | registry.registerFactory<Sink::ApplicationDomain::Mail, ImapMailAdaptorFactory>(name); | 958 | registry.registerFactory<ApplicationDomain::Mail, DefaultAdaptorFactory<ApplicationDomain::Mail>>(name); |
959 | registry.registerFactory<Sink::ApplicationDomain::Folder, ImapFolderAdaptorFactory>(name); | 959 | registry.registerFactory<ApplicationDomain::Folder, DefaultAdaptorFactory<ApplicationDomain::Folder>>(name); |
960 | } | 960 | } |
961 | 961 | ||
962 | void ImapResourceFactory::removeDataFromDisk(const QByteArray &instanceIdentifier) | 962 | void ImapResourceFactory::removeDataFromDisk(const QByteArray &instanceIdentifier) |