MailTransport

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

KDE's Doxygen guidelines are available online.