KIMAP

idjob.cpp
1/*
2 SPDX-FileCopyrightText: 2015 Christian Mollekopf <mollekopf@kolabsys.com>
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
15namespace KIMAP
16{
17class IdJobPrivate : public JobPrivate
18{
19public:
20 IdJobPrivate(Session *session, const QString &name)
21 : JobPrivate(session, name)
22 {
23 }
24 ~IdJobPrivate()
25 {
26 }
27
29};
30}
31
32using namespace KIMAP;
33
34IdJob::IdJob(Session *session)
35 : Job(*new IdJobPrivate(session, i18n("Id")))
36{
37}
38
39IdJob::~IdJob()
40{
41}
42
43void IdJob::setField(const QByteArray &name, const QByteArray &value)
44{
45 Q_D(IdJob);
46 d->fields.insert(name, value);
47}
48
49void 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
65void 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:25
QString i18n(const char *text, const TYPE &arg...)
QString name(StandardAction id)
void chop(qsizetype n)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:52:37 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.