KIMAP

idjob.cpp
1 /*
2  SPDX-FileCopyrightText: 2015 Christian Mollekopf <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "idjob.h"
8 
9 #include <KLocalizedString>
10 
11 #include "job_p.h"
12 #include "response_p.h"
13 #include "session_p.h"
14 
15 namespace KIMAP
16 {
17  class IdJobPrivate : public JobPrivate
18  {
19  public:
20  IdJobPrivate(Session *session, const QString& name) : JobPrivate(session, name) { }
21  ~IdJobPrivate() { }
22 
24  };
25 }
26 
27 using namespace KIMAP;
28 
29 IdJob::IdJob(Session *session)
30  : Job(*new IdJobPrivate(session, i18n("Id")))
31 {
32 }
33 
34 IdJob::~IdJob()
35 {
36 }
37 
38 void IdJob::setField(const QByteArray &name, const QByteArray &value)
39 {
40  Q_D(IdJob);
41  d->fields.insert(name, value);
42 }
43 
44 void IdJob::doStart()
45 {
46  Q_D(IdJob);
47  QByteArray command = "ID";
48  command += " (";
49 
51  while (i.hasNext()) {
52  i.next();
53  command += "\"" + i.key() + "\" \"" + i.value() + "\" ";
54  }
55  command.chop(1);
56  command += ")";
57  d->tags << d->sessionInternal()->sendCommand(command);
58 }
59 
60 void IdJob::handleResponse(const Response &response)
61 {
62  //Q_D(IdJob);
63  if (handleErrorReplies(response) == NotHandled) {
64  // Ignore the response
65  }
66 }
void chop(int n)
Reports client id.
Definition: idjob.h:25
QString i18n(const char *text, const TYPE &arg...)
Definition: acl.cpp:12
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Oct 24 2020 23:16:51 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.