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+
' ';
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 );
139 #include "appendjob.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Nov 26 2012 16:46:44 by
doxygen 1.8.1.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.