diff options
Diffstat (limited to 'common/domain/applicationdomaintype.cpp')
-rw-r--r-- | common/domain/applicationdomaintype.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp index 3cc075b..78a667e 100644 --- a/common/domain/applicationdomaintype.cpp +++ b/common/domain/applicationdomaintype.cpp | |||
@@ -18,10 +18,56 @@ | |||
18 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 18 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
19 | */ | 19 | */ |
20 | #include "applicationdomaintype.h" | 20 | #include "applicationdomaintype.h" |
21 | #include "../bufferadaptor.h" | ||
21 | 22 | ||
22 | namespace Akonadi2 { | 23 | namespace Akonadi2 { |
23 | namespace ApplicationDomain { | 24 | namespace ApplicationDomain { |
24 | 25 | ||
26 | ApplicationDomainType::ApplicationDomainType() | ||
27 | :mAdaptor(new MemoryBufferAdaptor()) | ||
28 | { | ||
29 | |||
30 | } | ||
31 | |||
32 | ApplicationDomainType::ApplicationDomainType(const QByteArray &resourceInstanceIdentifier) | ||
33 | :mAdaptor(new MemoryBufferAdaptor()), | ||
34 | mResourceInstanceIdentifier(resourceInstanceIdentifier) | ||
35 | { | ||
36 | |||
37 | } | ||
38 | |||
39 | ApplicationDomainType::ApplicationDomainType(const QByteArray &resourceInstanceIdentifier, const QByteArray &identifier, qint64 revision, const QSharedPointer<BufferAdaptor> &adaptor) | ||
40 | : mAdaptor(adaptor), | ||
41 | mResourceInstanceIdentifier(resourceInstanceIdentifier), | ||
42 | mIdentifier(identifier), | ||
43 | mRevision(revision) | ||
44 | { | ||
45 | } | ||
46 | |||
47 | ApplicationDomainType::ApplicationDomainType(const ApplicationDomainType &other) | ||
48 | { | ||
49 | *this = other; | ||
50 | } | ||
51 | |||
52 | ApplicationDomainType& ApplicationDomainType::operator=(const ApplicationDomainType &other) | ||
53 | { | ||
54 | mAdaptor = other.mAdaptor; | ||
55 | mChangeSet = other.mChangeSet; | ||
56 | mResourceInstanceIdentifier = other.mResourceInstanceIdentifier; | ||
57 | mIdentifier = other.mIdentifier; | ||
58 | mRevision = other.mRevision; | ||
59 | return *this; | ||
60 | } | ||
61 | |||
62 | ApplicationDomainType::~ApplicationDomainType() {} | ||
63 | |||
64 | QVariant ApplicationDomainType::getProperty(const QByteArray &key) const { return mAdaptor->getProperty(key); } | ||
65 | void ApplicationDomainType::setProperty(const QByteArray &key, const QVariant &value){ mChangeSet.insert(key, value); mAdaptor->setProperty(key, value); } | ||
66 | QByteArrayList ApplicationDomainType::changedProperties() const { return mChangeSet.keys(); } | ||
67 | qint64 ApplicationDomainType::revision() const { return mRevision; } | ||
68 | QByteArray ApplicationDomainType::resourceInstanceIdentifier() const { return mResourceInstanceIdentifier; } | ||
69 | QByteArray ApplicationDomainType::identifier() const { return mIdentifier; } | ||
70 | |||
25 | template<> | 71 | template<> |
26 | QByteArray getTypeName<Event>() | 72 | QByteArray getTypeName<Event>() |
27 | { | 73 | { |