KIMAP

closejob.cpp
1/*
2 SPDX-FileCopyrightText: 2009 Andras Mantia <amantia@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "closejob.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 CloseJobPrivate : public JobPrivate
18{
19public:
20 CloseJobPrivate(Session *session, const QString &name)
21 : JobPrivate(session, name)
22 {
23 }
24
25 quint64 highestModSeq = 0;
26};
27}
28
29using namespace KIMAP;
30
31CloseJob::CloseJob(Session *session)
32 : Job(*new CloseJobPrivate(session, i18n("Close")))
33{
34}
35
36void CloseJob::doStart()
37{
39 d->tags << d->sessionInternal()->sendCommand("CLOSE");
40}
41
43{
44 Q_D(const CloseJob);
45 return d->highestModSeq;
46}
47
48void CloseJob::handleResponse(const Response &response)
49{
51
52 if (response.responseCode.size() >= 2 && response.responseCode[0].toString() == "HIGHESTMODSEQ") {
53 d->highestModSeq = response.responseCode[1].toString().toULongLong();
54 }
55
56 Job::handleErrorReplies(response);
57}
58
59#include "moc_closejob.cpp"
Closes the current mailbox.
Definition closejob.h:41
quint64 newHighestModSeq() const
Returns new modification sequence number after expunging messages.
Definition closejob.cpp:42
QString i18n(const char *text, const TYPE &arg...)
QString name(StandardAction id)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:17 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.