Akonadi

tagdeletejob.cpp
1/*
2 SPDX-FileCopyrightText: 2014 Christian Mollekopf <mollekopf@kolabsys.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "tagdeletejob.h"
8#include "job_p.h"
9#include "protocolhelper_p.h"
10
11using namespace Akonadi;
12
13class Akonadi::TagDeleteJobPrivate : public JobPrivate
14{
15public:
16 explicit TagDeleteJobPrivate(TagDeleteJob *parent)
17 : JobPrivate(parent)
18 {
19 }
20
21 Tag::List mTagsToRemove;
22};
23
24TagDeleteJob::TagDeleteJob(const Akonadi::Tag &tag, QObject *parent)
25 : Job(new TagDeleteJobPrivate(this), parent)
26{
28 d->mTagsToRemove << tag;
29}
30
31TagDeleteJob::TagDeleteJob(const Tag::List &tags, QObject *parent)
32 : Job(new TagDeleteJobPrivate(this), parent)
33{
35 d->mTagsToRemove = tags;
36}
37
39{
41
42 d->sendCommand(Protocol::DeleteTagCommandPtr::create(ProtocolHelper::entitySetToScope(d->mTagsToRemove)));
43}
44
46{
47 if (!response->isResponse() || response->type() != Protocol::Command::DeleteTag) {
48 return Job::doHandleResponse(tag, response);
49 }
50
51 return true;
52}
53
55{
56 Q_D(const TagDeleteJob);
57 return d->mTagsToRemove;
58}
59
60#include "moc_tagdeletejob.cpp"
Base class for all actions in the Akonadi storage.
Definition job.h:81
virtual bool doHandleResponse(qint64 tag, const Protocol::CommandPtr &response)
This method should be reimplemented in the concrete jobs in case you want to handle incoming data.
Definition job.cpp:381
Job that deletes tags.
void doStart() override
This method must be reimplemented in the concrete jobs.
Tag::List tags() const
Returns the tags passed to the constructor.
bool doHandleResponse(qint64 tag, const Protocol::CommandPtr &response) override
This method should be reimplemented in the concrete jobs in case you want to handle incoming data.
An Akonadi Tag.
Definition tag.h:26
Helper integration between Akonadi and Qt.
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.