diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-04-09 15:21:06 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-04-09 15:21:06 +0200 |
commit | cc3fed3668a80616ec78bc872e21b7ac06bcde38 (patch) | |
tree | ab4888ae0050e5b56f59662dd356523b3a421043 /tests/domainadaptortest.cpp | |
parent | c4e098fae7340d6d73cd4fbe880440baca1ddd49 (diff) | |
download | sink-cc3fed3668a80616ec78bc872e21b7ac06bcde38.tar.gz sink-cc3fed3668a80616ec78bc872e21b7ac06bcde38.zip |
Renamed Akonadi::Domain to Akonadi::ApplicationDomain
Because it's really the application domain and not the akonadi domain.
Diffstat (limited to 'tests/domainadaptortest.cpp')
-rw-r--r-- | tests/domainadaptortest.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/domainadaptortest.cpp b/tests/domainadaptortest.cpp index e45a9a3..9cc3938 100644 --- a/tests/domainadaptortest.cpp +++ b/tests/domainadaptortest.cpp | |||
@@ -13,11 +13,11 @@ | |||
13 | #include "metadata_generated.h" | 13 | #include "metadata_generated.h" |
14 | #include "entity_generated.h" | 14 | #include "entity_generated.h" |
15 | 15 | ||
16 | class TestEventAdaptor : public Akonadi2::Domain::BufferAdaptor | 16 | class TestEventAdaptor : public Akonadi2::ApplicationDomain::BufferAdaptor |
17 | { | 17 | { |
18 | public: | 18 | public: |
19 | TestEventAdaptor() | 19 | TestEventAdaptor() |
20 | : Akonadi2::Domain::BufferAdaptor() | 20 | : Akonadi2::ApplicationDomain::BufferAdaptor() |
21 | { | 21 | { |
22 | } | 22 | } |
23 | 23 | ||
@@ -40,20 +40,20 @@ public: | |||
40 | return QVariant(); | 40 | return QVariant(); |
41 | } | 41 | } |
42 | 42 | ||
43 | Akonadi2::Domain::Buffer::Event const *mLocalBuffer; | 43 | Akonadi2::ApplicationDomain::Buffer::Event const *mLocalBuffer; |
44 | Akonadi2::Domain::Buffer::Event const *mResourceBuffer; | 44 | Akonadi2::ApplicationDomain::Buffer::Event const *mResourceBuffer; |
45 | 45 | ||
46 | QSharedPointer<PropertyMapper<Akonadi2::Domain::Buffer::Event> > mLocalMapper; | 46 | QSharedPointer<PropertyMapper<Akonadi2::ApplicationDomain::Buffer::Event> > mLocalMapper; |
47 | QSharedPointer<PropertyMapper<Akonadi2::Domain::Buffer::Event> > mResourceMapper; | 47 | QSharedPointer<PropertyMapper<Akonadi2::ApplicationDomain::Buffer::Event> > mResourceMapper; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | class TestFactory : public DomainTypeAdaptorFactory<Akonadi2::Domain::Event, Akonadi2::Domain::Buffer::Event, Akonadi2::Domain::Buffer::Event> | 50 | class TestFactory : public DomainTypeAdaptorFactory<Akonadi2::ApplicationDomain::Event, Akonadi2::ApplicationDomain::Buffer::Event, Akonadi2::ApplicationDomain::Buffer::Event> |
51 | { | 51 | { |
52 | public: | 52 | public: |
53 | TestFactory() | 53 | TestFactory() |
54 | { | 54 | { |
55 | mResourceMapper = QSharedPointer<PropertyMapper<Akonadi2::Domain::Buffer::Event> >::create(); | 55 | mResourceMapper = QSharedPointer<PropertyMapper<Akonadi2::ApplicationDomain::Buffer::Event> >::create(); |
56 | mResourceMapper->mReadAccessors.insert("summary", [](Akonadi2::Domain::Buffer::Event const *buffer) -> QVariant { | 56 | mResourceMapper->mReadAccessors.insert("summary", [](Akonadi2::ApplicationDomain::Buffer::Event const *buffer) -> QVariant { |
57 | if (buffer->summary()) { | 57 | if (buffer->summary()) { |
58 | return QString::fromStdString(buffer->summary()->c_str()); | 58 | return QString::fromStdString(buffer->summary()->c_str()); |
59 | } | 59 | } |
@@ -61,13 +61,13 @@ public: | |||
61 | }); | 61 | }); |
62 | } | 62 | } |
63 | 63 | ||
64 | virtual QSharedPointer<Akonadi2::Domain::BufferAdaptor> createAdaptor(const Akonadi2::Entity &entity) | 64 | virtual QSharedPointer<Akonadi2::ApplicationDomain::BufferAdaptor> createAdaptor(const Akonadi2::Entity &entity) |
65 | { | 65 | { |
66 | Akonadi2::Domain::Buffer::Event const *resourceBuffer = 0; | 66 | Akonadi2::ApplicationDomain::Buffer::Event const *resourceBuffer = 0; |
67 | if (auto resourceData = entity.resource()) { | 67 | if (auto resourceData = entity.resource()) { |
68 | flatbuffers::Verifier verifyer(resourceData->Data(), resourceData->size()); | 68 | flatbuffers::Verifier verifyer(resourceData->Data(), resourceData->size()); |
69 | if (Akonadi2::Domain::Buffer::VerifyEventBuffer(verifyer)) { | 69 | if (Akonadi2::ApplicationDomain::Buffer::VerifyEventBuffer(verifyer)) { |
70 | resourceBuffer = Akonadi2::Domain::Buffer::GetEvent(resourceData->Data()); | 70 | resourceBuffer = Akonadi2::ApplicationDomain::Buffer::GetEvent(resourceData->Data()); |
71 | if (resourceBuffer->summary()) { | 71 | if (resourceBuffer->summary()) { |
72 | qDebug() << QString::fromStdString(std::string(resourceBuffer->summary()->c_str())); | 72 | qDebug() << QString::fromStdString(std::string(resourceBuffer->summary()->c_str())); |
73 | } | 73 | } |
@@ -82,11 +82,11 @@ public: | |||
82 | // } | 82 | // } |
83 | // } | 83 | // } |
84 | 84 | ||
85 | Akonadi2::Domain::Buffer::Event const *localBuffer = 0; | 85 | Akonadi2::ApplicationDomain::Buffer::Event const *localBuffer = 0; |
86 | if (auto localData = entity.local()) { | 86 | if (auto localData = entity.local()) { |
87 | flatbuffers::Verifier verifyer(localData->Data(), localData->size()); | 87 | flatbuffers::Verifier verifyer(localData->Data(), localData->size()); |
88 | if (Akonadi2::Domain::Buffer::VerifyEventBuffer(verifyer)) { | 88 | if (Akonadi2::ApplicationDomain::Buffer::VerifyEventBuffer(verifyer)) { |
89 | localBuffer = Akonadi2::Domain::Buffer::GetEvent(localData); | 89 | localBuffer = Akonadi2::ApplicationDomain::Buffer::GetEvent(localData); |
90 | } | 90 | } |
91 | } | 91 | } |
92 | 92 | ||
@@ -127,12 +127,12 @@ private Q_SLOTS: | |||
127 | static uint8_t rawData[100]; | 127 | static uint8_t rawData[100]; |
128 | auto attachment = m_fbb.CreateVector(rawData, 100); | 128 | auto attachment = m_fbb.CreateVector(rawData, 100); |
129 | 129 | ||
130 | auto builder = Akonadi2::Domain::Buffer::EventBuilder(m_fbb); | 130 | auto builder = Akonadi2::ApplicationDomain::Buffer::EventBuilder(m_fbb); |
131 | builder.add_summary(summary); | 131 | builder.add_summary(summary); |
132 | builder.add_description(description); | 132 | builder.add_description(description); |
133 | builder.add_attachment(attachment); | 133 | builder.add_attachment(attachment); |
134 | auto buffer = builder.Finish(); | 134 | auto buffer = builder.Finish(); |
135 | Akonadi2::Domain::Buffer::FinishEventBuffer(m_fbb, buffer); | 135 | Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(m_fbb, buffer); |
136 | 136 | ||
137 | flatbuffers::FlatBufferBuilder fbb; | 137 | flatbuffers::FlatBufferBuilder fbb; |
138 | Akonadi2::EntityBuffer::assembleEntityBuffer(fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize(), m_fbb.GetBufferPointer(), m_fbb.GetSize(), m_fbb.GetBufferPointer(), m_fbb.GetSize()); | 138 | Akonadi2::EntityBuffer::assembleEntityBuffer(fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize(), m_fbb.GetBufferPointer(), m_fbb.GetSize(), m_fbb.GetBufferPointer(), m_fbb.GetSize()); |