Akonadi

resourceselectjob.cpp
1 /*
2  Copyright (c) 2009 Volker Krause <[email protected]>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #include "resourceselectjob_p.h"
21 
22 #include "job_p.h"
23 #include "private/imapparser_p.h"
24 #include "private/protocol_p.h"
25 
26 using namespace Akonadi;
27 
28 class Akonadi::ResourceSelectJobPrivate : public JobPrivate
29 {
30 public:
31  ResourceSelectJobPrivate(ResourceSelectJob *parent)
32  : JobPrivate(parent)
33  {
34  }
35 
36  QString resourceId;
37  QString jobDebuggingString() const override;
38 };
39 
40 QString Akonadi::ResourceSelectJobPrivate::jobDebuggingString() const
41 {
42  return QStringLiteral("Select Resource %1").arg(resourceId);
43 }
44 
45 ResourceSelectJob::ResourceSelectJob(const QString &identifier, QObject *parent)
46  : Job(new ResourceSelectJobPrivate(this), parent)
47 {
48  Q_D(ResourceSelectJob);
49  d->resourceId = identifier;
50 }
51 
52 void ResourceSelectJob::doStart()
53 {
54  Q_D(ResourceSelectJob);
55 
56  d->sendCommand(Protocol::SelectResourceCommandPtr::create(d->resourceId));
57 }
58 
59 bool ResourceSelectJob::doHandleResponse(qint64 tag, const Protocol::CommandPtr &response)
60 {
61  if (!response->isResponse() || response->type() != Protocol::Command::SelectResource) {
62  return Job::doHandleResponse(tag, response);
63  }
64 
65  return true;
66 }
67 
68 #include "moc_resourceselectjob_p.cpp"
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:385
Base class for all actions in the Akonadi storage.
Definition: job.h:93
quint64 tag() const
The tag of the command associated with this handler.
Definition: handler.cpp:208
Helper integration between Akonadi and Qt.
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jun 5 2020 23:08:56 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.