KIMAP Library
20 #include "setquotajob.h"
22 #include <KDE/KLocale>
25 #include "quotajobbase_p.h"
26 #include "message_p.h"
27 #include "session_p.h"
31 class SetQuotaJobPrivate :
public QuotaJobBasePrivate
34 SetQuotaJobPrivate( Session *session,
const QString& name ) : QuotaJobBasePrivate( session, name ) { }
35 ~SetQuotaJobPrivate() { }
37 QMap<QByteArray, qint64> setList;
42 using namespace KIMAP;
44 SetQuotaJob::SetQuotaJob( Session *session )
45 :
QuotaJobBase( *new SetQuotaJobPrivate( session, i18n(
"SetQuota" ) ) )
49 SetQuotaJob::~SetQuotaJob()
53 void SetQuotaJob::doStart()
58 for ( QMap<QByteArray, qint64>::ConstIterator it = d->setList.constBegin(); it != d->setList.constEnd(); ++it ) {
59 s += it.key() +
' ' + QByteArray::number( it.value() ) +
' ';
61 if ( d->setList.isEmpty() ) {
64 s[s.length() - 1] =
')';
67 kDebug() <<
"SETQUOTA " <<
'\"' + d->root +
"\" " + s;
69 d->tags << d->sessionInternal()->sendCommand(
"SETQUOTA",
'\"' + d->root +
"\" " + s );
72 void SetQuotaJob::handleResponse(
const Message &response)
75 if ( handleErrorReplies( response ) == NotHandled ) {
76 if ( response.content.size() >= 4 &&
77 response.content[1].toString() ==
"QUOTA" ) {
78 d->quota = d->readQuota( response.content[3] );
88 d->setList[resource.toUpper()] =
limit;
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:25:17 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.