KIMAP2

idjob.cpp
1/*
2 Copyright (c) 2015 Christian Mollekopf <mollekopf@kolabsys.com>
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 "idjob.h"
21
22#include "job_p.h"
23#include "message_p.h"
24#include "session_p.h"
25
26namespace KIMAP2
27{
28 class IdJobPrivate : public JobPrivate
29 {
30 public:
31 IdJobPrivate(Session *session, const QString& name) : JobPrivate(session, name) { }
32 ~IdJobPrivate() { }
33
35 };
36}
37
38using namespace KIMAP2;
39
40IdJob::IdJob(Session *session)
41 : Job(*new IdJobPrivate(session, "Id"))
42{
43}
44
45IdJob::~IdJob()
46{
47}
48
49void IdJob::setField(const QByteArray &name, const QByteArray &value)
50{
51 Q_D(IdJob);
52 d->fields.insert(name, value);
53}
54
55void IdJob::doStart()
56{
57 Q_D(IdJob);
58 QByteArray command = "ID";
59 command += " (";
60
62 while (i.hasNext()) {
63 i.next();
64 command += "\"" + i.key() + "\" \"" + i.value() + "\" ";
65 }
66 command.chop(1);
67 command += ")";
68 d->sendCommand(command, {});
69}
70
71void IdJob::handleResponse(const Message &response)
72{
73 if (handleErrorReplies(response) == NotHandled) {
74 // Ignore the response
75 }
76}
Reports client id.
Definition idjob.h:39
QString name(GameStandardAction 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 Nov 29 2024 11:56:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.