00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "itemmovejob.h"
00021
00022 #include "collection.h"
00023 #include "item.h"
00024 #include "job_p.h"
00025 #include "protocolhelper_p.h"
00026 #include <akonadi/private/imapparser_p.h>
00027 #include "movejobimpl_p.h"
00028
00029 using namespace Akonadi;
00030
00031 class Akonadi::ItemMoveJobPrivate: public MoveJobImpl<Item, ItemMoveJob>
00032 {
00033 public:
00034 ItemMoveJobPrivate( ItemMoveJob *parent ) : MoveJobImpl<Item, ItemMoveJob>( parent ) {}
00035 Q_DECLARE_PUBLIC( ItemMoveJob )
00036 };
00037
00038 ItemMoveJob::ItemMoveJob(const Item &item, const Collection &destination, QObject *parent) :
00039 Job( new ItemMoveJobPrivate( this ), parent )
00040 {
00041 Q_D( ItemMoveJob );
00042 d->destination = destination;
00043 d->objectsToMove.append( item );
00044 }
00045
00046 ItemMoveJob::ItemMoveJob( const Item::List &items, const Collection &destination, QObject* parent) :
00047 Job( new ItemMoveJobPrivate( this ), parent )
00048 {
00049 Q_D( ItemMoveJob );
00050 d->destination = destination;
00051 d->objectsToMove = items;
00052 }
00053
00054 ItemMoveJob::~ItemMoveJob()
00055 {
00056 }
00057
00058 void ItemMoveJob::doStart()
00059 {
00060 Q_D( ItemMoveJob );
00061 d->sendCommand( "MOVE" );
00062 }
00063
00064 #include "itemmovejob.moc"