mailtransport
22 #include "sentactionattribute.h"
24 #include <QtCore/QDataStream>
25 #include <QtCore/QSharedData>
27 using namespace Akonadi;
28 using namespace MailTransport;
30 class SentActionAttribute::Action::Private :
public QSharedData
38 Private(
const Private &other )
39 : QSharedData( other )
42 mValue = other.mValue;
49 SentActionAttribute::Action::Action()
82 if (
this != &other ) {
91 return ( ( d->mType == other.d->mType ) && ( d->mValue == other.d->mValue ) );
94 class SentActionAttribute::Private
112 d->mActions.append(
Action( type, value ) );
123 attribute->d->mActions = d->mActions;
128 QByteArray SentActionAttribute::type()
const
130 static const QByteArray sType(
"SentActionAttribute" );
134 QByteArray SentActionAttribute::serialized()
const
137 foreach (
const Action &action, d->mActions ) {
139 map.insert( QString::number( action.type() ), action.value() );
141 list << QVariant( map );
145 QDataStream stream( &data, QIODevice::WriteOnly );
146 stream.setVersion( QDataStream::Qt_4_6 );
152 void SentActionAttribute::deserialize(
const QByteArray &data )
156 QDataStream stream( data );
157 stream.setVersion( QDataStream::Qt_4_6 );
162 foreach (
const QVariant &variant, list ) {
163 const QVariantMap map = variant.toMap();
164 QMapIterator<QString, QVariant> it( map );
165 while ( it.hasNext() ) {
167 d->mActions << Action( static_cast<Action::Type>( it.key().toInt() ), it.value() );
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:26:52 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.