summaryrefslogtreecommitdiffstats
path: root/common/domain
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-12-22 10:42:37 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-12-22 10:42:37 +0100
commit31dbc0cba9e5acfaeca41679873b17e11ceab811 (patch)
treeceabdf4f92666d92c72e9382c8c0c80bed23b837 /common/domain
parente5125013a2661b30f21323f1a3f925103e8d589f (diff)
downloadsink-31dbc0cba9e5acfaeca41679873b17e11ceab811.tar.gz
sink-31dbc0cba9e5acfaeca41679873b17e11ceab811.zip
Only load the properties we need.
...and adjust the test accordingly with what we expect.
Diffstat (limited to 'common/domain')
-rw-r--r--common/domain/applicationdomaintype.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h
index 227ab4d..cff0172 100644
--- a/common/domain/applicationdomaintype.h
+++ b/common/domain/applicationdomaintype.h
@@ -46,10 +46,9 @@ public:
46 ApplicationDomainType& operator=(const ApplicationDomainType &other); 46 ApplicationDomainType& operator=(const ApplicationDomainType &other);
47 47
48 template <typename DomainType> 48 template <typename DomainType>
49 static typename DomainType::Ptr getInMemoryRepresentation(const ApplicationDomainType &domainType) 49 static typename DomainType::Ptr getInMemoryRepresentation(const ApplicationDomainType &domainType, const QList<QByteArray> properties = QList<QByteArray>())
50 { 50 {
51 //TODO only copy requested properties 51 auto memoryAdaptor = QSharedPointer<Akonadi2::ApplicationDomain::MemoryBufferAdaptor>::create(*(domainType.mAdaptor), properties);
52 auto memoryAdaptor = QSharedPointer<Akonadi2::ApplicationDomain::MemoryBufferAdaptor>::create(*(domainType.mAdaptor));
53 //The identifier still internal refers to the memory-mapped pointer, we need to copy the memory or it will become invalid 52 //The identifier still internal refers to the memory-mapped pointer, we need to copy the memory or it will become invalid
54 return QSharedPointer<DomainType>::create(domainType.mResourceInstanceIdentifier, QByteArray(domainType.mIdentifier.constData(), domainType.mIdentifier.size()), domainType.mRevision, memoryAdaptor); 53 return QSharedPointer<DomainType>::create(domainType.mResourceInstanceIdentifier, QByteArray(domainType.mIdentifier.constData(), domainType.mIdentifier.size()), domainType.mRevision, memoryAdaptor);
55 } 54 }