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

0001 /*
0002     SPDX-FileCopyrightText: 2008 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "unlinkjob.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::UnlinkJobPrivate : public LinkJobImpl<UnlinkJob>
0016 {
0017 public:
0018     explicit UnlinkJobPrivate(UnlinkJob *parent)
0019         : LinkJobImpl<UnlinkJob>(parent)
0020     {
0021     }
0022 };
0023 
0024 UnlinkJob::UnlinkJob(const Collection &collection, const Item::List &items, QObject *parent)
0025     : Job(new UnlinkJobPrivate(this), parent)
0026 {
0027     Q_D(UnlinkJob);
0028     d->destination = collection;
0029     d->objectsToLink = items;
0030 }
0031 
0032 UnlinkJob::~UnlinkJob()
0033 {
0034 }
0035 
0036 void UnlinkJob::doStart()
0037 {
0038     Q_D(UnlinkJob);
0039     d->sendCommand(Protocol::LinkItemsCommand::Unlink);
0040 }
0041 
0042 bool UnlinkJob::doHandleResponse(qint64 tag, const Protocol::CommandPtr &response)
0043 {
0044     Q_D(UnlinkJob);
0045     return d->handleResponse(tag, response);
0046 }
0047 
0048 #include "moc_unlinkjob.cpp"