Akonadi Contacts

contactmetadataattribute.cpp
1 /*
2  This file is part of Akonadi Contact.
3 
4  SPDX-FileCopyrightText: 2009 Tobias Koenig <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #include "contactmetadataattribute_p.h"
10 
11 #include <QDataStream>
12 
13 using namespace Akonadi;
14 
15 class Q_DECL_HIDDEN ContactMetaDataAttribute::Private
16 {
17 public:
18  QVariantMap mData;
19 };
20 
21 ContactMetaDataAttribute::ContactMetaDataAttribute()
22  : d(new Private)
23 {
24 }
25 
26 ContactMetaDataAttribute::~ContactMetaDataAttribute()
27 {
28  delete d;
29 }
30 
31 void ContactMetaDataAttribute::setMetaData(const QVariantMap &data)
32 {
33  d->mData = data;
34 }
35 
36 QVariantMap ContactMetaDataAttribute::metaData() const
37 {
38  return d->mData;
39 }
40 
41 QByteArray ContactMetaDataAttribute::type() const
42 {
43  static const QByteArray sType("contactmetadata");
44  return sType;
45 }
46 
47 Attribute *ContactMetaDataAttribute::clone() const
48 {
49  auto copy = new ContactMetaDataAttribute;
50  copy->setMetaData(d->mData);
51 
52  return copy;
53 }
54 
55 QByteArray ContactMetaDataAttribute::serialized() const
56 {
57  QByteArray data;
59  s.setVersion(QDataStream::Qt_4_5);
60  s << d->mData;
61 
62  return data;
63 }
64 
65 void ContactMetaDataAttribute::deserialize(const QByteArray &data)
66 {
67  QDataStream s(data);
68  s.setVersion(QDataStream::Qt_4_5);
69  s >> d->mData;
70 }
void setMetaData(const KIO::MetaData &metaData)
KIOCORE_EXPORT CopyJob * copy(const QUrl &src, const QUrl &dest, JobFlags flags=DefaultFlags)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jun 23 2021 23:09:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.