Akonadi

resourceselectjob.cpp
1/*
2 SPDX-FileCopyrightText: 2009 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "resourceselectjob_p.h"
8
9#include "job_p.h"
10#include "private/imapparser_p.h"
11#include "private/protocol_p.h"
12
13using namespace Akonadi;
14
15class Akonadi::ResourceSelectJobPrivate : public JobPrivate
16{
17public:
18 explicit ResourceSelectJobPrivate(ResourceSelectJob *parent)
19 : JobPrivate(parent)
20 {
21 }
22
23 QString resourceId;
24 QString jobDebuggingString() const override;
25};
26
27QString Akonadi::ResourceSelectJobPrivate::jobDebuggingString() const
28{
29 return QStringLiteral("Select Resource %1").arg(resourceId);
30}
31
32ResourceSelectJob::ResourceSelectJob(const QString &identifier, QObject *parent)
33 : Job(new ResourceSelectJobPrivate(this), parent)
34{
35 Q_D(ResourceSelectJob);
36 d->resourceId = identifier;
37}
38
39void ResourceSelectJob::doStart()
40{
41 Q_D(ResourceSelectJob);
42
43 d->sendCommand(Protocol::SelectResourceCommandPtr::create(d->resourceId));
44}
45
46bool ResourceSelectJob::doHandleResponse(qint64 tag, const Protocol::CommandPtr &response)
47{
48 if (!response->isResponse() || response->type() != Protocol::Command::SelectResource) {
49 return Job::doHandleResponse(tag, response);
50 }
51
52 return true;
53}
54
55#include "moc_resourceselectjob_p.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
Helper integration between Akonadi and Qt.
QString arg(Args &&... args) const const
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.