akonadi
20 #include "subscriptionjob_p.h"
24 using namespace Akonadi;
26 class Akonadi::SubscriptionJobPrivate :
public JobPrivate
29 SubscriptionJobPrivate( SubscriptionJob *parent )
30 : JobPrivate( parent )
34 void sendCommand(
const QByteArray &cmd,
const Collection::List &list )
37 QByteArray line = mTag +
' ' + cmd;
38 foreach (
const Collection &col, list )
39 line +=
' ' + QByteArray::number( col.id() );
45 void sendNextCommand()
47 Q_Q( SubscriptionJob );
50 if ( !mSub.isEmpty() ) {
51 sendCommand(
"SUBSCRIBE", mSub );
53 }
else if ( !mUnsub.isEmpty() ) {
54 sendCommand(
"UNSUBSCRIBE", mUnsub );
61 Q_DECLARE_PUBLIC( SubscriptionJob )
64 Collection::List mSub, mUnsub;
68 :
Job( new SubscriptionJobPrivate( this ), parent )
72 SubscriptionJob::~SubscriptionJob()
90 void SubscriptionJob::doStart()
97 void SubscriptionJob::doHandleResponse(
const QByteArray &_tag,
const QByteArray & data)
101 if ( _tag == d->mTag ) {
102 if ( data.startsWith(
"OK" ) ) {
103 d->sendNextCommand();
106 setErrorText( QString::fromUtf8( data ) );
113 #include "subscriptionjob_p.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Sep 24 2012 09:06:28 by
doxygen 1.8.1.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.