Akonadi Mime

pop3resourceattribute.cpp
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "pop3resourceattribute.h"
8
9#include <QByteArray>
10#include <QDataStream>
11#include <QIODevice>
12namespace Akonadi
13{
14class Pop3ResourceAttributePrivate
15{
16public:
17 QString accountName;
18};
19
20Pop3ResourceAttribute::Pop3ResourceAttribute()
21 : d(new Pop3ResourceAttributePrivate)
22{
23}
24
25Pop3ResourceAttribute::~Pop3ResourceAttribute() = default;
26
27Pop3ResourceAttribute *Pop3ResourceAttribute::clone() const
28{
29 auto attr = new Pop3ResourceAttribute();
30 attr->setPop3AccountName(pop3AccountName());
31 return attr;
32}
33
34QByteArray Pop3ResourceAttribute::type() const
35{
36 static const QByteArray sType("pop3resourceattribute");
37 return sType;
38}
39
40QByteArray Pop3ResourceAttribute::serialized() const
41{
42 QByteArray result;
44 s << pop3AccountName();
45 return result;
46}
47
48void Pop3ResourceAttribute::deserialize(const QByteArray &data)
49{
50 QDataStream s(data);
51 QString value;
52 s >> value;
53 d->accountName = value;
54}
55
56QString Pop3ResourceAttribute::pop3AccountName() const
57{
58 return d->accountName;
59}
60
61void Pop3ResourceAttribute::setPop3AccountName(const QString &accountName)
62{
63 d->accountName = accountName;
64}
65
66bool Pop3ResourceAttribute::operator==(const Pop3ResourceAttribute &other) const
67{
68 return d->accountName == other.pop3AccountName();
69}
70
71} // namespace Akonadi
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:04:17 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.