File indexing completed on 2024-05-12 05:17:18
0001 /* 0002 SPDX-FileCopyrightText: 2009 Andras Mantia <amantia@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "subscribejob.h" 0008 0009 #include <KLocalizedString> 0010 0011 #include "job_p.h" 0012 #include "response_p.h" 0013 #include "rfccodecs.h" 0014 #include "session_p.h" 0015 0016 namespace KIMAP 0017 { 0018 class SubscribeJobPrivate : public JobPrivate 0019 { 0020 public: 0021 SubscribeJobPrivate(Session *session, const QString &name) 0022 : JobPrivate(session, name) 0023 { 0024 } 0025 ~SubscribeJobPrivate() 0026 { 0027 } 0028 0029 QString mailBox; 0030 }; 0031 } 0032 0033 using namespace KIMAP; 0034 0035 SubscribeJob::SubscribeJob(Session *session) 0036 : Job(*new SubscribeJobPrivate(session, i18n("Subscribe"))) 0037 { 0038 } 0039 0040 SubscribeJob::~SubscribeJob() 0041 { 0042 } 0043 0044 void SubscribeJob::doStart() 0045 { 0046 Q_D(SubscribeJob); 0047 d->tags << d->sessionInternal()->sendCommand("SUBSCRIBE", '\"' + KIMAP::encodeImapFolderName(d->mailBox.toUtf8()) + '\"'); 0048 } 0049 0050 void SubscribeJob::setMailBox(const QString &mailBox) 0051 { 0052 Q_D(SubscribeJob); 0053 d->mailBox = mailBox; 0054 } 0055 0056 QString SubscribeJob::mailBox() const 0057 { 0058 Q_D(const SubscribeJob); 0059 return d->mailBox; 0060 } 0061 0062 #include "moc_subscribejob.cpp"