KIMAP Library
22 #include <KDE/KLocalizedString>
26 #include "message_p.h"
27 #include "session_p.h"
34 class CopyJobPrivate :
public JobPrivate
37 CopyJobPrivate( Session *session,
const QString& name ) : JobPrivate( session, name ) { }
47 using namespace KIMAP;
49 CopyJob::CopyJob( Session *session )
50 : Job( *new CopyJobPrivate( session, i18n(
"Copy" ) ) )
87 d->uidBased = uidBased;
99 return d->resultingUids;
102 void CopyJob::doStart()
106 QByteArray parameters = d->set.toImapSequenceSet()+
' ';
109 QByteArray command =
"COPY";
111 command =
"UID "+command;
114 d->tags << d->sessionInternal()->sendCommand( command, parameters );
117 void CopyJob::handleResponse(
const Message &response )
121 for ( QList<Message::Part>::ConstIterator it = response.responseCode.begin();
122 it != response.responseCode.end(); ++it ) {
123 if ( it->toString() ==
"COPYUID" ) {
125 if ( it < response.responseCode.end() ) {
132 handleErrorReplies( response );
QString encodeImapFolderName(const QString &src)
Converts an Unicode IMAP mailbox to a QString which can be used in IMAP communication.
static ImapSet fromImapSequenceSet(const QByteArray &sequence)
Return the set corresponding to the given IMAP-compatible QByteArray representation.
ImapSet resultingUids() const
The UIDs of the new copies of the messages.
void setSequenceSet(const ImapSet &set)
Sets the messages to be copied.
Represents a set of natural numbers (1-> ) in a as compact as possible form.
bool isUidBased() const
How to interpret the sequence set.
QString mailBox() const
The destination mailbox.
ImapSet sequenceSet() const
The messages that will be copied.
Copies one or more messages to another mailbox.
void setMailBox(const QString &mailBox)
Sets the destination mailbox.
void setUidBased(bool uidBased)
Set how the sequence set should be interpreted.
Provides handlers for various RFC/MIME encodings.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jan 29 2020 00:00:00 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.