diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-05-01 16:39:19 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-05-01 16:39:19 +0200 |
commit | 6a26ef88dd3375ea28ae5c6d7f8987b470208b16 (patch) | |
tree | 3060ee0304d02c8ce2f753a639dcf03bf0ada9c4 | |
parent | 096d14f20f4dc39d20d35d605ca755b66bd48cf9 (diff) | |
download | sink-6a26ef88dd3375ea28ae5c6d7f8987b470208b16.tar.gz sink-6a26ef88dd3375ea28ae5c6d7f8987b470208b16.zip |
Helper to set application domain types.
-rw-r--r-- | common/domain/applicationdomaintype.cpp | 6 | ||||
-rw-r--r-- | common/domain/applicationdomaintype.h | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp index 23a63a7..27f94ce 100644 --- a/common/domain/applicationdomaintype.cpp +++ b/common/domain/applicationdomaintype.cpp | |||
@@ -88,6 +88,12 @@ void ApplicationDomainType::setProperty(const QByteArray &key, const QVariant &v | |||
88 | mAdaptor->setProperty(key, value); | 88 | mAdaptor->setProperty(key, value); |
89 | } | 89 | } |
90 | 90 | ||
91 | void ApplicationDomainType::setProperty(const QByteArray &key, const ApplicationDomainType &value) | ||
92 | { | ||
93 | Q_ASSERT(!value.identifier().isEmpty()); | ||
94 | setProperty(key, value.identifier()); | ||
95 | } | ||
96 | |||
91 | QByteArray ApplicationDomainType::getBlobProperty(const QByteArray &key) const | 97 | QByteArray ApplicationDomainType::getBlobProperty(const QByteArray &key) const |
92 | { | 98 | { |
93 | const auto path = getProperty(key).toByteArray(); | 99 | const auto path = getProperty(key).toByteArray(); |
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index e00b244..58beb97 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h | |||
@@ -43,8 +43,8 @@ public: | |||
43 | typedef QSharedPointer<ApplicationDomainType> Ptr; | 43 | typedef QSharedPointer<ApplicationDomainType> Ptr; |
44 | 44 | ||
45 | ApplicationDomainType(); | 45 | ApplicationDomainType(); |
46 | ApplicationDomainType(const QByteArray &resourceInstanceIdentifier); | 46 | explicit ApplicationDomainType(const QByteArray &resourceInstanceIdentifier); |
47 | ApplicationDomainType(const QByteArray &resourceInstanceIdentifier, const QByteArray &identifier, qint64 revision, const QSharedPointer<BufferAdaptor> &adaptor); | 47 | explicit ApplicationDomainType(const QByteArray &resourceInstanceIdentifier, const QByteArray &identifier, qint64 revision, const QSharedPointer<BufferAdaptor> &adaptor); |
48 | ApplicationDomainType(const ApplicationDomainType &other); | 48 | ApplicationDomainType(const ApplicationDomainType &other); |
49 | ApplicationDomainType& operator=(const ApplicationDomainType &other); | 49 | ApplicationDomainType& operator=(const ApplicationDomainType &other); |
50 | 50 | ||
@@ -70,6 +70,7 @@ public: | |||
70 | 70 | ||
71 | QVariant getProperty(const QByteArray &key) const; | 71 | QVariant getProperty(const QByteArray &key) const; |
72 | void setProperty(const QByteArray &key, const QVariant &value); | 72 | void setProperty(const QByteArray &key, const QVariant &value); |
73 | void setProperty(const QByteArray &key, const ApplicationDomainType &value); | ||
73 | 74 | ||
74 | QByteArray getBlobProperty(const QByteArray &key) const; | 75 | QByteArray getBlobProperty(const QByteArray &key) const; |
75 | void setBlobProperty(const QByteArray &key, const QByteArray &value); | 76 | void setBlobProperty(const QByteArray &key, const QByteArray &value); |