Akonadi

resourceselectjob.cpp
1 /*
2  SPDX-FileCopyrightText: 2009 Volker Krause <[email protected]>
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 
13 using namespace Akonadi;
14 
15 class Akonadi::ResourceSelectJobPrivate : public JobPrivate
16 {
17 public:
18  explicit ResourceSelectJobPrivate(ResourceSelectJob *parent)
19  : JobPrivate(parent)
20  {
21  }
22 
23  QString resourceId;
24  QString jobDebuggingString() const override;
25 };
26 
27 QString Akonadi::ResourceSelectJobPrivate::jobDebuggingString() const
28 {
29  return QStringLiteral("Select Resource %1").arg(resourceId);
30 }
31 
32 ResourceSelectJob::ResourceSelectJob(const QString &identifier, QObject *parent)
33  : Job(new ResourceSelectJobPrivate(this), parent)
34 {
35  Q_D(ResourceSelectJob);
36  d->resourceId = identifier;
37 }
38 
39 void ResourceSelectJob::doStart()
40 {
41  Q_D(ResourceSelectJob);
42 
43  d->sendCommand(Protocol::SelectResourceCommandPtr::create(d->resourceId));
44 }
45 
46 bool 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:80
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
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
Q_D(Todo)
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jun 30 2022 03:51:46 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.