KIMAP Library
20 #include "appendjob.h"
22 #include <KDE/KLocale>
25 #include "message_p.h"
26 #include "session_p.h"
31 class AppendJobPrivate :
public JobPrivate
34 AppendJobPrivate( Session *session,
const QString& name ) : JobPrivate( session, name ), uid( 0 ) { }
35 ~AppendJobPrivate() { }
38 QList<QByteArray> flags;
44 using namespace KIMAP;
46 AppendJob::AppendJob( Session *session )
47 : Job( *new AppendJobPrivate( session, i18n(
"Append" ) ) )
51 AppendJob::~AppendJob()
97 void AppendJob::doStart()
101 QByteArray parameters =
'\"' + KIMAP::encodeImapFolderName( d->mailBox.toUtf8() ) +
'\"';
103 if ( !d->flags.isEmpty() ) {
105 foreach (
const QByteArray &flag, d->flags ) {
106 parameters+= flag +
' ';
108 parameters.chop( 1 );
112 parameters +=
" {" + QByteArray::number( d->content.size() ) +
'}';
114 d->tags << d->sessionInternal()->sendCommand(
"APPEND", parameters );
117 void AppendJob::handleResponse(
const Message &response )
121 for ( QList<Message::Part>::ConstIterator it = response.responseCode.begin();
122 it != response.responseCode.end(); ++it ) {
123 if ( it->toString() ==
"APPENDUID" ) {
125 if ( it != response.responseCode.end() ) {
126 d->uid = it->toString().toLongLong();
132 if ( handleErrorReplies( response ) == NotHandled ) {
133 if ( response.content[0].toString() ==
"+" ) {
134 d->sessionInternal()->sendData( d->content );
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:25:16 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.