Akonadi Mime

errorattribute.cpp
1/*
2 SPDX-FileCopyrightText: 2009 Constantin Berzan <exit3219@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "errorattribute.h"
8
9using namespace Akonadi;
10
11class Akonadi::ErrorAttributePrivate
12{
13public:
14 QString mMessage;
15};
16
18 : d(new ErrorAttributePrivate)
19{
20 d->mMessage = msg;
21}
22
24
25ErrorAttribute *ErrorAttribute::clone() const
26{
27 return new ErrorAttribute(d->mMessage);
28}
29
30QByteArray ErrorAttribute::type() const
31{
32 static const QByteArray sType("ErrorAttribute");
33 return sType;
34}
35
36QByteArray ErrorAttribute::serialized() const
37{
38 return d->mMessage.toUtf8();
39}
40
41void ErrorAttribute::deserialize(const QByteArray &data)
42{
43 d->mMessage = QString::fromUtf8(data);
44}
45
47{
48 return d->mMessage;
49}
50
52{
53 d->mMessage = msg;
54}
An Attribute to mark messages that failed to be sent.
ErrorAttribute(const QString &msg=QString())
Creates a new error attribute.
QString message() const
Returns the i18n'ed error message.
void setMessage(const QString &msg)
Sets the i18n'ed error message.
~ErrorAttribute() override
Destroys the error attribute.
QString fromUtf8(QByteArrayView str)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:52:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.