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)
21  : JobPrivate(session, name)
22  {
23  }
24  ~IdJobPrivate()
25  {
26  }
27 
29 };
30 }
31 
32 using namespace KIMAP;
33 
34 IdJob::IdJob(Session *session)
35  : Job(*new IdJobPrivate(session, i18n("Id")))
36 {
37 }
38 
39 IdJob::~IdJob()
40 {
41 }
42 
43 void IdJob::setField(const QByteArray &name, const QByteArray &value)
44 {
45  Q_D(IdJob);
46  d->fields.insert(name, value);
47 }
48 
49 void IdJob::doStart()
50 {
51  Q_D(IdJob);
52  QByteArray command = "ID";
53  command += " (";
54 
56  while (i.hasNext()) {
57  i.next();
58  command += "\"" + i.key() + "\" \"" + i.value() + "\" ";
59  }
60  command.chop(1);
61  command += ")";
62  d->tags << d->sessionInternal()->sendCommand(command);
63 }
64 
65 void IdJob::handleResponse(const Response &response)
66 {
67  // Q_D(IdJob);
68  if (handleErrorReplies(response) == NotHandled) {
69  // Ignore the response
70  }
71 }
72 
73 #include "moc_idjob.cpp"
Reports client id.
Definition: idjob.h:24
void chop(int n)
QString i18n(const char *text, const TYPE &arg...)
const char * name(StandardAction id)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Dec 10 2023 03:48:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.