KIMAP

getquotajob.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 "getquotajob.h"
8
9#include <KLocalizedString>
10
11#include "quotajobbase_p.h"
12#include "response_p.h"
13#include "session_p.h"
14
15namespace KIMAP
16{
17class GetQuotaJobPrivate : public QuotaJobBasePrivate
18{
19public:
20 GetQuotaJobPrivate(Session *session, const QString &name)
21 : QuotaJobBasePrivate(session, name)
22 {
23 }
24 ~GetQuotaJobPrivate()
25 {
26 }
27
28 QByteArray root;
29};
30}
31
32using namespace KIMAP;
33
34GetQuotaJob::GetQuotaJob(Session *session)
35 : QuotaJobBase(*new GetQuotaJobPrivate(session, i18n("GetQuota")))
36{
37}
38
39GetQuotaJob::~GetQuotaJob()
40{
41}
42
43void GetQuotaJob::doStart()
44{
46 // XXX: [alexmerry, 2010-07-24]: should d->root be quoted properly?
47 d->tags << d->sessionInternal()->sendCommand("GETQUOTA", '\"' + d->root + '\"');
48}
49
50void GetQuotaJob::handleResponse(const Response &response)
51{
53 if (handleErrorReplies(response) == NotHandled) {
54 if (response.content.size() >= 4 && response.content[1].toString() == "QUOTA") {
55 d->quota = d->readQuota(response.content[3]);
56 }
57 }
58}
59
61{
63 d->root = root;
64}
65
67{
68 Q_D(const GetQuotaJob);
69 return d->root;
70}
71
72#include "moc_getquotajob.cpp"
Gets resource limits for a quota root.
Definition getquotajob.h:37
QByteArray root() const
The quota root that resource limit information will be fetched for.
void setRoot(const QByteArray &root)
Set the quota root to get the resource limits for.
Base class for jobs that operate on mailbox quotas.
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 Fri Dec 20 2024 11:51:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.