KIMAP

closejob.cpp
1 /*
2  SPDX-FileCopyrightText: 2009 Andras Mantia <[email protected]>
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 
15 namespace KIMAP
16 {
17 class CloseJobPrivate : public JobPrivate
18 {
19 public:
20  CloseJobPrivate(Session *session, const QString &name)
21  : JobPrivate(session, name)
22  {
23  }
24 
25  quint64 highestModSeq = 0;
26 };
27 }
28 
29 using namespace KIMAP;
30 
31 CloseJob::CloseJob(Session *session)
32  : Job(*new CloseJobPrivate(session, i18n("Close")))
33 {
34 }
35 
36 void CloseJob::doStart()
37 {
38  Q_D(CloseJob);
39  d->tags << d->sessionInternal()->sendCommand("CLOSE");
40 }
41 
43 {
44  Q_D(const CloseJob);
45  return d->highestModSeq;
46 }
47 
48 void CloseJob::handleResponse(const Response &response)
49 {
50  Q_D(CloseJob);
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:40
QString i18n(const char *text, const TYPE &arg...)
quint64 newHighestModSeq() const
Returns new modification sequence number after expunging messages.
Definition: closejob.cpp:42
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.