• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.9.4 API Reference
  • KDE Home
  • Contact Us
 

KIMAP Library

  • kimap
getquotajob.cpp
1 /*
2  Copyright (c) 2009 Andras Mantia <amantia@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #include "getquotajob.h"
21 
22 #include <KDE/KLocale>
23 #include <KDE/KDebug>
24 
25 #include "quotajobbase_p.h"
26 #include "message_p.h"
27 #include "session_p.h"
28 
29 namespace KIMAP
30 {
31  class GetQuotaJobPrivate : public QuotaJobBasePrivate
32  {
33  public:
34  GetQuotaJobPrivate( Session *session, const QString& name ) : QuotaJobBasePrivate(session, name) { }
35  ~GetQuotaJobPrivate() { }
36 
37  QByteArray root;
38  };
39 }
40 
41 using namespace KIMAP;
42 
43 GetQuotaJob::GetQuotaJob( Session *session )
44  : QuotaJobBase( *new GetQuotaJobPrivate(session, i18n("GetQuota")) )
45 {
46 }
47 
48 GetQuotaJob::~GetQuotaJob()
49 {
50 }
51 
52 void GetQuotaJob::doStart()
53 {
54  Q_D(GetQuotaJob);
55  //XXX: [alexmerry, 2010-07-24]: should d->root be quoted properly?
56  d->tags << d->sessionInternal()->sendCommand( "GETQUOTA", '\"' + d->root + '\"');
57 }
58 
59 void GetQuotaJob::handleResponse(const Message &response)
60 {
61  Q_D(GetQuotaJob);
62  if (handleErrorReplies(response) == NotHandled) {
63  if ( response.content.size() >= 4
64  && response.content[1].toString() == "QUOTA" ) {
65  d->quota = d->readQuota(response.content[3]);
66  }
67  }
68 }
69 
70 void GetQuotaJob::setRoot(const QByteArray& root)
71 {
72  Q_D(GetQuotaJob);
73 
74  d->root = root;
75 }
76 
77 QByteArray GetQuotaJob::root() const
78 {
79  Q_D(const GetQuotaJob);
80 
81  return d->root;
82 }
83 
84 #include "getquotajob.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Tue Dec 11 2012 12:12:46 by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIMAP Library

Skip menu "KIMAP Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.9.4 API Reference

Skip menu "kdepimlibs-4.9.4 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal