diff options
-rw-r--r-- | common/domain/applicationdomaintype.cpp | 6 | ||||
-rw-r--r-- | common/domain/applicationdomaintype.h | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp index e219608..a57a50b 100644 --- a/common/domain/applicationdomaintype.cpp +++ b/common/domain/applicationdomaintype.cpp | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "log.h" | 21 | #include "log.h" |
22 | #include "../bufferadaptor.h" | 22 | #include "../bufferadaptor.h" |
23 | #include "definitions.h" | 23 | #include "definitions.h" |
24 | #include "storage.h" //for generateUid() | ||
24 | #include <QFile> | 25 | #include <QFile> |
25 | 26 | ||
26 | namespace Sink { | 27 | namespace Sink { |
@@ -66,6 +67,11 @@ ApplicationDomainType::~ApplicationDomainType() | |||
66 | { | 67 | { |
67 | } | 68 | } |
68 | 69 | ||
70 | QByteArray ApplicationDomainType::generateUid() | ||
71 | { | ||
72 | return Sink::Storage::generateUid(); | ||
73 | } | ||
74 | |||
69 | bool ApplicationDomainType::hasProperty(const QByteArray &key) const | 75 | bool ApplicationDomainType::hasProperty(const QByteArray &key) const |
70 | { | 76 | { |
71 | Q_ASSERT(mAdaptor); | 77 | Q_ASSERT(mAdaptor); |
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index a41882d..b011eb5 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <QDebug> | 27 | #include <QDebug> |
28 | #include <QUuid> | 28 | #include <QUuid> |
29 | #include "bufferadaptor.h" | 29 | #include "bufferadaptor.h" |
30 | #include "storage.h" //for generateUid() | ||
31 | 30 | ||
32 | #define SINK_ENTITY(TYPE) \ | 31 | #define SINK_ENTITY(TYPE) \ |
33 | typedef QSharedPointer<TYPE> Ptr; \ | 32 | typedef QSharedPointer<TYPE> Ptr; \ |
@@ -102,11 +101,13 @@ public: | |||
102 | return QSharedPointer<DomainType>::create(domainType.mResourceInstanceIdentifier, QByteArray(domainType.mIdentifier.constData(), domainType.mIdentifier.size()), domainType.mRevision, memoryAdaptor); | 101 | return QSharedPointer<DomainType>::create(domainType.mResourceInstanceIdentifier, QByteArray(domainType.mIdentifier.constData(), domainType.mIdentifier.size()), domainType.mRevision, memoryAdaptor); |
103 | } | 102 | } |
104 | 103 | ||
104 | static QByteArray generateUid(); | ||
105 | |||
105 | template <class DomainType> | 106 | template <class DomainType> |
106 | static DomainType createEntity() | 107 | static DomainType createEntity() |
107 | { | 108 | { |
108 | DomainType object; | 109 | DomainType object; |
109 | object.mIdentifier = Sink::Storage::generateUid(); | 110 | object.mIdentifier = generateUid(); |
110 | return object; | 111 | return object; |
111 | } | 112 | } |
112 | 113 | ||
@@ -114,7 +115,7 @@ public: | |||
114 | static DomainType createEntity(const QByteArray &resourceInstanceIdentifier) | 115 | static DomainType createEntity(const QByteArray &resourceInstanceIdentifier) |
115 | { | 116 | { |
116 | DomainType object(resourceInstanceIdentifier); | 117 | DomainType object(resourceInstanceIdentifier); |
117 | object.mIdentifier = Sink::Storage::generateUid(); | 118 | object.mIdentifier = generateUid(); |
118 | return object; | 119 | return object; |
119 | } | 120 | } |
120 | 121 | ||