summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-03-21 14:12:14 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-03-21 14:12:14 +0100
commitdaf96f7efec0538e161eab8e906a291015842e1e (patch)
tree577af79efecd96e0d2187d495628d9950f2a9d45 /examples
parent7a98c9853726ed09abd35a447f9854c5459a855d (diff)
downloadsink-daf96f7efec0538e161eab8e906a291015842e1e.tar.gz
sink-daf96f7efec0538e161eab8e906a291015842e1e.zip
Default domain adaptor
Diffstat (limited to 'examples')
-rw-r--r--examples/davresource/CMakeLists.txt2
-rw-r--r--examples/davresource/davresource.cpp4
-rw-r--r--examples/davresource/domainadaptor.cpp35
-rw-r--r--examples/davresource/domainadaptor.h38
-rw-r--r--examples/imapresource/CMakeLists.txt2
-rw-r--r--examples/imapresource/domainadaptor.cpp35
-rw-r--r--examples/imapresource/domainadaptor.h38
-rw-r--r--examples/imapresource/imapresource.cpp4
-rw-r--r--examples/maildirresource/CMakeLists.txt2
-rw-r--r--examples/maildirresource/domainadaptor.cpp35
-rw-r--r--examples/maildirresource/domainadaptor.h38
-rw-r--r--examples/maildirresource/maildirresource.cpp4
-rw-r--r--examples/mailtransportresource/mailtransportresource.cpp1
13 files changed, 9 insertions, 229 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
6find_package(KPimKDAV REQUIRED) 6find_package(KPimKDAV REQUIRED)
7 7
8add_library(${PROJECT_NAME} SHARED davresource.cpp domainadaptor.cpp) 8add_library(${PROJECT_NAME} SHARED davresource.cpp)
9qt5_use_modules(${PROJECT_NAME} Core Network) 9qt5_use_modules(${PROJECT_NAME} Core Network)
10target_link_libraries(${PROJECT_NAME} sink KPim::KDAV) 10target_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
278void DavResourceFactory::registerAdaptorFactories(const QByteArray &name, Sink::AdaptorFactoryRegistry &registry) 278void DavResourceFactory::registerAdaptorFactories(const QByteArray &name, Sink::AdaptorFactoryRegistry &registry)
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
284void DavResourceFactory::removeDataFromDisk(const QByteArray &instanceIdentifier) 284void 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
22using namespace flatbuffers;
23
24ContactAdaptorFactory::ContactAdaptorFactory()
25 : DomainTypeAdaptorFactory()
26{
27
28}
29
30AddressbookAdaptorFactory::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
26class ContactAdaptorFactory : public DomainTypeAdaptorFactory<Sink::ApplicationDomain::Contact, Sink::ApplicationDomain::Buffer::Dummy, Sink::ApplicationDomain::Buffer::DummyBuilder>
27{
28public:
29 ContactAdaptorFactory();
30 virtual ~ContactAdaptorFactory() {};
31};
32
33class AddressbookAdaptorFactory : public DomainTypeAdaptorFactory<Sink::ApplicationDomain::Folder, Sink::ApplicationDomain::Buffer::Dummy, Sink::ApplicationDomain::Buffer::DummyBuilder>
34{
35public:
36 AddressbookAdaptorFactory();
37 virtual ~AddressbookAdaptorFactory() {};
38};
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
9include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 9include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
10 10
11add_library(${PROJECT_NAME} SHARED imapresource.cpp domainadaptor.cpp imapserverproxy.cpp) 11add_library(${PROJECT_NAME} SHARED imapresource.cpp imapserverproxy.cpp)
12qt5_use_modules(${PROJECT_NAME} Core Network) 12qt5_use_modules(${PROJECT_NAME} Core Network)
13target_link_libraries(${PROJECT_NAME} sink KF5::Mime KIMAP2) 13target_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
22using namespace flatbuffers;
23
24ImapMailAdaptorFactory::ImapMailAdaptorFactory()
25 : DomainTypeAdaptorFactory()
26{
27
28}
29
30ImapFolderAdaptorFactory::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
26class ImapMailAdaptorFactory : public DomainTypeAdaptorFactory<Sink::ApplicationDomain::Mail, Sink::ApplicationDomain::Buffer::Dummy, Sink::ApplicationDomain::Buffer::DummyBuilder>
27{
28public:
29 ImapMailAdaptorFactory();
30 virtual ~ImapMailAdaptorFactory() {};
31};
32
33class ImapFolderAdaptorFactory : public DomainTypeAdaptorFactory<Sink::ApplicationDomain::Folder, Sink::ApplicationDomain::Buffer::Dummy, Sink::ApplicationDomain::Buffer::DummyBuilder>
34{
35public:
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
956void ImapResourceFactory::registerAdaptorFactories(const QByteArray &name, Sink::AdaptorFactoryRegistry &registry) 956void ImapResourceFactory::registerAdaptorFactories(const QByteArray &name, Sink::AdaptorFactoryRegistry &registry)
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
962void ImapResourceFactory::removeDataFromDisk(const QByteArray &instanceIdentifier) 962void ImapResourceFactory::removeDataFromDisk(const QByteArray &instanceIdentifier)
diff --git a/examples/maildirresource/CMakeLists.txt b/examples/maildirresource/CMakeLists.txt
index b96c50f..a8f0359 100644
--- a/examples/maildirresource/CMakeLists.txt
+++ b/examples/maildirresource/CMakeLists.txt
@@ -5,7 +5,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
5 5
6find_package(KF5 COMPONENTS REQUIRED Mime) 6find_package(KF5 COMPONENTS REQUIRED Mime)
7 7
8add_library(${PROJECT_NAME} SHARED facade.cpp maildirresource.cpp domainadaptor.cpp libmaildir/maildir.cpp libmaildir/keycache.cpp) 8add_library(${PROJECT_NAME} SHARED facade.cpp maildirresource.cpp libmaildir/maildir.cpp libmaildir/keycache.cpp)
9qt5_use_modules(${PROJECT_NAME} Core Network) 9qt5_use_modules(${PROJECT_NAME} Core Network)
10target_link_libraries(${PROJECT_NAME} sink KF5::Mime) 10target_link_libraries(${PROJECT_NAME} sink KF5::Mime)
11 11
diff --git a/examples/maildirresource/domainadaptor.cpp b/examples/maildirresource/domainadaptor.cpp
deleted file mode 100644
index 71b2354..0000000
--- a/examples/maildirresource/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
22using namespace flatbuffers;
23
24MaildirMailAdaptorFactory::MaildirMailAdaptorFactory()
25 : DomainTypeAdaptorFactory()
26{
27
28}
29
30MaildirFolderAdaptorFactory::MaildirFolderAdaptorFactory()
31 : DomainTypeAdaptorFactory()
32{
33
34}
35
diff --git a/examples/maildirresource/domainadaptor.h b/examples/maildirresource/domainadaptor.h
deleted file mode 100644
index 700d2e5..0000000
--- a/examples/maildirresource/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
26class MaildirMailAdaptorFactory : public DomainTypeAdaptorFactory<Sink::ApplicationDomain::Mail, Sink::ApplicationDomain::Buffer::Dummy, Sink::ApplicationDomain::Buffer::DummyBuilder>
27{
28public:
29 MaildirMailAdaptorFactory();
30 virtual ~MaildirMailAdaptorFactory() {};
31};
32
33class MaildirFolderAdaptorFactory : public DomainTypeAdaptorFactory<Sink::ApplicationDomain::Folder, Sink::ApplicationDomain::Buffer::Dummy, Sink::ApplicationDomain::Buffer::DummyBuilder>
34{
35public:
36 MaildirFolderAdaptorFactory();
37 virtual ~MaildirFolderAdaptorFactory() {};
38};
diff --git a/examples/maildirresource/maildirresource.cpp b/examples/maildirresource/maildirresource.cpp
index f80b799..a2a2f05 100644
--- a/examples/maildirresource/maildirresource.cpp
+++ b/examples/maildirresource/maildirresource.cpp
@@ -596,8 +596,8 @@ void MaildirResourceFactory::registerFacades(const QByteArray &name, Sink::Facad
596 596
597void MaildirResourceFactory::registerAdaptorFactories(const QByteArray &name, Sink::AdaptorFactoryRegistry &registry) 597void MaildirResourceFactory::registerAdaptorFactories(const QByteArray &name, Sink::AdaptorFactoryRegistry &registry)
598{ 598{
599 registry.registerFactory<Sink::ApplicationDomain::Mail, MaildirMailAdaptorFactory>(name); 599 registry.registerFactory<ApplicationDomain::Mail, DefaultAdaptorFactory<ApplicationDomain::Mail>>(name);
600 registry.registerFactory<Sink::ApplicationDomain::Folder, MaildirFolderAdaptorFactory>(name); 600 registry.registerFactory<ApplicationDomain::Folder, DefaultAdaptorFactory<ApplicationDomain::Folder>>(name);
601} 601}
602 602
603void MaildirResourceFactory::removeDataFromDisk(const QByteArray &instanceIdentifier) 603void MaildirResourceFactory::removeDataFromDisk(const QByteArray &instanceIdentifier)
diff --git a/examples/mailtransportresource/mailtransportresource.cpp b/examples/mailtransportresource/mailtransportresource.cpp
index 6beb4e8..673fae4 100644
--- a/examples/mailtransportresource/mailtransportresource.cpp
+++ b/examples/mailtransportresource/mailtransportresource.cpp
@@ -30,7 +30,6 @@
30#include <KMime/Message> 30#include <KMime/Message>
31 31
32#include "mailtransport.h" 32#include "mailtransport.h"
33#include "mail_generated.h"
34#include "inspection.h" 33#include "inspection.h"
35#include <synchronizer.h> 34#include <synchronizer.h>
36#include <log.h> 35#include <log.h>