KIMAP Library
setacljob.cpp
00001 /* 00002 Copyright (c) 2009 Andras Mantia <amantia@kde.org> 00003 00004 This library is free software; you can redistribute it and/or modify it 00005 under the terms of the GNU Library General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or (at your 00007 option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, but WITHOUT 00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to the 00016 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 02110-1301, USA. 00018 */ 00019 00020 #include "setacljob.h" 00021 00022 #include <KDE/KLocale> 00023 #include <KDE/KDebug> 00024 00025 #include "acljobbase_p.h" 00026 #include "message_p.h" 00027 #include "session_p.h" 00028 #include "rfccodecs.h" 00029 00030 namespace KIMAP 00031 { 00032 class SetAclJobPrivate : public AclJobBasePrivate 00033 { 00034 public: 00035 SetAclJobPrivate( Session *session, const QString& name ) : AclJobBasePrivate(session, name) {} 00036 ~SetAclJobPrivate() { } 00037 }; 00038 } 00039 00040 using namespace KIMAP; 00041 00042 SetAclJob::SetAclJob( Session *session ) 00043 : AclJobBase(*new SetAclJobPrivate(session, i18n("SetAcl"))) 00044 { 00045 00046 } 00047 00048 SetAclJob::~SetAclJob() 00049 { 00050 } 00051 00052 void SetAclJob::doStart() 00053 { 00054 Q_D(SetAclJob); 00055 QByteArray r = Acl::rightsToString( d->rightList ); 00056 if (d->modifier == Add) { 00057 r.prepend('+'); 00058 } else if (d->modifier == Remove) { 00059 r.prepend('-'); 00060 } 00061 d->tags << d->sessionInternal()->sendCommand( "SETACL", '\"' + KIMAP::encodeImapFolderName( d->mailBox.toUtf8() ) + "\" \"" + d->id + "\" \"" + r +'\"'); 00062 } 00063 00064 void SetAclJob::setRights(AclModifier modifier, Acl::Rights rights) 00065 { 00066 Q_D(SetAclJob); 00067 d->setRights(modifier, rights); 00068 } 00069 00070 void SetAclJob::setIdentifier( const QByteArray &identifier ) 00071 { 00072 Q_D(SetAclJob); 00073 d->setIdentifier(identifier); 00074 } 00075 00076 QByteArray SetAclJob::identifier() 00077 { 00078 Q_D(SetAclJob); 00079 return d->identifier(); 00080 } 00081 00082 #include "setacljob.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 7 2012 23:55:09 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 7 2012 23:55:09 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.