summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/clientapi.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/common/clientapi.h b/common/clientapi.h
index 05c4675..ee4ef3f 100644
--- a/common/clientapi.h
+++ b/common/clientapi.h
@@ -112,6 +112,14 @@ public:
112 { 112 {
113 } 113 }
114 114
115 template <typename DomainType>
116 static typename DomainType::Ptr getInMemoryRepresentation(const ApplicationDomainType::Ptr &domainType)
117 {
118 //TODO only copy requested properties
119 auto memoryAdaptor = QSharedPointer<Akonadi2::ApplicationDomain::MemoryBufferAdaptor>::create(*(domainType->mAdaptor));
120 return QSharedPointer<DomainType>::create(domainType->mResourceName, domainType->mIdentifier, domainType->mRevision, memoryAdaptor);
121 }
122
115 virtual ~ApplicationDomainType() {} 123 virtual ~ApplicationDomainType() {}
116 124
117 virtual QVariant getProperty(const QByteArray &key) const { return mAdaptor->getProperty(key); } 125 virtual QVariant getProperty(const QByteArray &key) const { return mAdaptor->getProperty(key); }
@@ -125,7 +133,7 @@ private:
125 /* 133 /*
126 * Each domain object needs to store the resource, identifier, revision triple so we can link back to the storage location. 134 * Each domain object needs to store the resource, identifier, revision triple so we can link back to the storage location.
127 */ 135 */
128 QString mResourceName; 136 QByteArray mResourceName;
129 QByteArray mIdentifier; 137 QByteArray mIdentifier;
130 qint64 mRevision; 138 qint64 mRevision;
131}; 139};