KIMAP

unsubscribejob.cpp
1 /*
2  SPDX-FileCopyrightText: 2009 Andras Mantia <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "unsubscribejob.h"
8 
9 #include <KLocalizedString>
10 
11 #include "job_p.h"
12 #include "response_p.h"
13 #include "session_p.h"
14 #include "rfccodecs.h"
15 
16 namespace KIMAP
17 {
18 class UnsubscribeJobPrivate : public JobPrivate
19 {
20 public:
21  UnsubscribeJobPrivate(Session *session, const QString &name) : JobPrivate(session, name) { }
22  ~UnsubscribeJobPrivate() { }
23 
24  QString mailBox;
25 };
26 }
27 
28 using namespace KIMAP;
29 
30 UnsubscribeJob::UnsubscribeJob(Session *session)
31  : Job(*new UnsubscribeJobPrivate(session, i18n("Unsubscribe")))
32 {
33 }
34 
35 UnsubscribeJob::~UnsubscribeJob()
36 {
37 }
38 
39 void UnsubscribeJob::doStart()
40 {
41  Q_D(UnsubscribeJob);
42  d->tags << d->sessionInternal()->sendCommand("UNSUBSCRIBE", '\"' + KIMAP::encodeImapFolderName(d->mailBox.toUtf8()) + '\"');
43 }
44 
45 void UnsubscribeJob::setMailBox(const QString &mailBox)
46 {
47  Q_D(UnsubscribeJob);
48  d->mailBox = mailBox;
49 }
50 
51 QString UnsubscribeJob::mailBox() const
52 {
53  Q_D(const UnsubscribeJob);
54  return d->mailBox;
55 }
This file is part of the IMAP support library and defines the RfcCodecs class.
QString i18n(const char *text, const TYPE &arg...)
Definition: acl.cpp:12
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Oct 24 2020 23:16:51 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.