Akonadi Mime

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 
11 class Akonadi::ErrorAttributePrivate
12 {
13 public:
14  QString mMessage;
15 };
16 
18  : d(new ErrorAttributePrivate)
19 {
20  d->mMessage = msg;
21 }
22 
24 
25 ErrorAttribute *ErrorAttribute::clone() const
26 {
27  return new ErrorAttribute(d->mMessage);
28 }
29 
30 QByteArray ErrorAttribute::type() const
31 {
32  static const QByteArray sType("ErrorAttribute");
33  return sType;
34 }
35 
36 QByteArray ErrorAttribute::serialized() const
37 {
38  return d->mMessage.toUtf8();
39 }
40 
41 void 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 }
QString fromUtf8(const char *str, int size)
An Attribute to mark messages that failed to be sent.
void setMessage(const QString &msg)
Sets the i18n'ed error message.
QString message() const
Returns the i18n'ed error message.
ErrorAttribute(const QString &msg=QString())
Creates a new error attribute.
~ErrorAttribute() override
Destroys the error attribute.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Nov 29 2023 03:53:46 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.