diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-04-10 12:32:03 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-04-10 12:32:03 +0200 |
commit | ea348c62fdebe1d9c6531fc4491d3316a1e941df (patch) | |
tree | a5984008eacf60154e3454544cb6d68969611fed /tests/domainadaptortest.cpp | |
parent | 2e13ef36cabbe1c995e77b92c06d6350719bf952 (diff) | |
download | sink-ea348c62fdebe1d9c6531fc4491d3316a1e941df.tar.gz sink-ea348c62fdebe1d9c6531fc4491d3316a1e941df.zip |
checkpoint
Diffstat (limited to 'tests/domainadaptortest.cpp')
-rw-r--r-- | tests/domainadaptortest.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/domainadaptortest.cpp b/tests/domainadaptortest.cpp index 9cc3938..74c0d62 100644 --- a/tests/domainadaptortest.cpp +++ b/tests/domainadaptortest.cpp | |||
@@ -23,16 +23,16 @@ public: | |||
23 | 23 | ||
24 | void setProperty(const QByteArray &key, const QVariant &value) | 24 | void setProperty(const QByteArray &key, const QVariant &value) |
25 | { | 25 | { |
26 | if (mResourceMapper->mWriteAccessors.contains(key)) { | 26 | // if (mResourceMapper->mWriteAccessors.contains(key)) { |
27 | // mResourceMapper.setProperty(key, value, mResourceBuffer); | 27 | // // mResourceMapper.setProperty(key, value, mResourceBuffer); |
28 | } else { | 28 | // } else { |
29 | // mLocalMapper.; | 29 | // // mLocalMapper.; |
30 | } | 30 | // } |
31 | } | 31 | } |
32 | 32 | ||
33 | virtual QVariant getProperty(const QByteArray &key) const | 33 | virtual QVariant getProperty(const QByteArray &key) const |
34 | { | 34 | { |
35 | if (mResourceBuffer && mResourceMapper->mReadAccessors.contains(key)) { | 35 | if (mResourceBuffer && mResourceMapper->hasMapping(key)) { |
36 | return mResourceMapper->getProperty(key, mResourceBuffer); | 36 | return mResourceMapper->getProperty(key, mResourceBuffer); |
37 | } else if (mLocalBuffer) { | 37 | } else if (mLocalBuffer) { |
38 | return mLocalMapper->getProperty(key, mLocalBuffer); | 38 | return mLocalMapper->getProperty(key, mLocalBuffer); |
@@ -43,8 +43,8 @@ public: | |||
43 | Akonadi2::ApplicationDomain::Buffer::Event const *mLocalBuffer; | 43 | Akonadi2::ApplicationDomain::Buffer::Event const *mLocalBuffer; |
44 | Akonadi2::ApplicationDomain::Buffer::Event const *mResourceBuffer; | 44 | Akonadi2::ApplicationDomain::Buffer::Event const *mResourceBuffer; |
45 | 45 | ||
46 | QSharedPointer<PropertyMapper<Akonadi2::ApplicationDomain::Buffer::Event> > mLocalMapper; | 46 | QSharedPointer<ReadPropertyMapper<Akonadi2::ApplicationDomain::Buffer::Event> > mLocalMapper; |
47 | QSharedPointer<PropertyMapper<Akonadi2::ApplicationDomain::Buffer::Event> > mResourceMapper; | 47 | QSharedPointer<ReadPropertyMapper<Akonadi2::ApplicationDomain::Buffer::Event> > mResourceMapper; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | class TestFactory : public DomainTypeAdaptorFactory<Akonadi2::ApplicationDomain::Event, Akonadi2::ApplicationDomain::Buffer::Event, Akonadi2::ApplicationDomain::Buffer::Event> | 50 | class TestFactory : public DomainTypeAdaptorFactory<Akonadi2::ApplicationDomain::Event, Akonadi2::ApplicationDomain::Buffer::Event, Akonadi2::ApplicationDomain::Buffer::Event> |
@@ -52,8 +52,8 @@ class TestFactory : public DomainTypeAdaptorFactory<Akonadi2::ApplicationDomain: | |||
52 | public: | 52 | public: |
53 | TestFactory() | 53 | TestFactory() |
54 | { | 54 | { |
55 | mResourceMapper = QSharedPointer<PropertyMapper<Akonadi2::ApplicationDomain::Buffer::Event> >::create(); | 55 | mResourceMapper = QSharedPointer<ReadPropertyMapper<Akonadi2::ApplicationDomain::Buffer::Event> >::create(); |
56 | mResourceMapper->mReadAccessors.insert("summary", [](Akonadi2::ApplicationDomain::Buffer::Event const *buffer) -> QVariant { | 56 | mResourceMapper->addMapping("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 | } |