diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-21 13:09:46 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-21 13:13:56 +0100 |
commit | 7a98c9853726ed09abd35a447f9854c5459a855d (patch) | |
tree | 50aa14c43ab616529d35fdf91f6ed8d69887c8ab /common/domain/folder.cpp | |
parent | a2a4d09cbd42d3de8380ee0061a80cdc0bfb4e6c (diff) | |
download | sink-7a98c9853726ed09abd35a447f9854c5459a855d.tar.gz sink-7a98c9853726ed09abd35a447f9854c5459a855d.zip |
Move type implementations in one place
Having them separated is rather pointless (since we need one for every
type, and all types are the interface of sink, as one), and caused quite
a bit of friction when adding new types. This will also make it easier
to change things for all types.
Diffstat (limited to 'common/domain/folder.cpp')
-rw-r--r-- | common/domain/folder.cpp | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/common/domain/folder.cpp b/common/domain/folder.cpp deleted file mode 100644 index 6717661..0000000 --- a/common/domain/folder.cpp +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2015 Christian Mollekopf <chrigi_1@fastfolder.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 | #include "folder.h" | ||
20 | |||
21 | #include <QByteArray> | ||
22 | #include <QString> | ||
23 | |||
24 | #include "../propertymapper.h" | ||
25 | #include "../typeindex.h" | ||
26 | #include "entitybuffer.h" | ||
27 | #include "entity_generated.h" | ||
28 | |||
29 | #include "folder_generated.h" | ||
30 | |||
31 | using namespace Sink::ApplicationDomain; | ||
32 | |||
33 | void TypeImplementation<Folder>::configure(TypeIndex &index) | ||
34 | { | ||
35 | index.addProperty<QByteArray>(Folder::Parent::name); | ||
36 | index.addProperty<QString>(Folder::Name::name); | ||
37 | } | ||
38 | |||
39 | void TypeImplementation<Folder>::configure(ReadPropertyMapper<Buffer> &propertyMapper) | ||
40 | { | ||
41 | propertyMapper.addMapping<Folder::Parent, Buffer>(&Buffer::parent); | ||
42 | propertyMapper.addMapping<Folder::Name, Buffer>(&Buffer::name); | ||
43 | propertyMapper.addMapping<Folder::Icon, Buffer>(&Buffer::icon); | ||
44 | propertyMapper.addMapping<Folder::SpecialPurpose, Buffer>(&Buffer::specialpurpose); | ||
45 | propertyMapper.addMapping<Folder::Enabled, Buffer>(&Buffer::enabled); | ||
46 | } | ||
47 | |||
48 | void TypeImplementation<Folder>::configure(WritePropertyMapper<BufferBuilder> &propertyMapper) | ||
49 | { | ||
50 | propertyMapper.addMapping<Folder::Parent>(&BufferBuilder::add_parent); | ||
51 | propertyMapper.addMapping<Folder::Name>(&BufferBuilder::add_name); | ||
52 | propertyMapper.addMapping<Folder::Icon>(&BufferBuilder::add_icon); | ||
53 | propertyMapper.addMapping<Folder::SpecialPurpose>(&BufferBuilder::add_specialpurpose); | ||
54 | propertyMapper.addMapping<Folder::Enabled>(&BufferBuilder::add_enabled); | ||
55 | } | ||
56 | |||
57 | void TypeImplementation<Folder>::configure(IndexPropertyMapper &) | ||
58 | { | ||
59 | |||
60 | } | ||