File indexing completed on 2024-11-10 04:40:31

0001 /*
0002     SPDX-FileCopyrightText: 2008 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "linkjob.h"
0008 
0009 #include "collection.h"
0010 #include "job_p.h"
0011 #include "linkjobimpl_p.h"
0012 
0013 using namespace Akonadi;
0014 
0015 class Akonadi::LinkJobPrivate : public LinkJobImpl<LinkJob>
0016 {
0017 public:
0018     explicit LinkJobPrivate(LinkJob *parent)
0019         : LinkJobImpl<LinkJob>(parent)
0020     {
0021     }
0022 };
0023 
0024 LinkJob::LinkJob(const Collection &collection, const Item::List &items, QObject *parent)
0025     : Job(new LinkJobPrivate(this), parent)
0026 {
0027     Q_D(LinkJob);
0028     d->destination = collection;
0029     d->objectsToLink = items;
0030 }
0031 
0032 LinkJob::~LinkJob()
0033 {
0034 }
0035 
0036 void LinkJob::doStart()
0037 {
0038     Q_D(LinkJob);
0039     d->sendCommand(Protocol::LinkItemsCommand::Link);
0040 }
0041 
0042 bool LinkJob::doHandleResponse(qint64 tag, const Protocol::CommandPtr &response)
0043 {
0044     return d_func()->handleResponse(tag, response);
0045 }
0046 
0047 #include "moc_linkjob.cpp"