akonadi
20 #include "recursiveitemfetchjob.h"
22 #include <akonadi/collectionfetchjob.h>
23 #include <akonadi/collectionfetchscope.h>
24 #include <akonadi/itemfetchjob.h>
25 #include <akonadi/itemfetchscope.h>
27 #include <QtCore/QStringList>
28 #include <QtCore/QVariant>
30 using namespace Akonadi;
32 class RecursiveItemFetchJob::Private
36 : mParent( parent ), mCollection( collection ), mMimeTypes( mimeTypes ), mFetchCount( 0 )
40 void collectionFetchResult( KJob *job )
43 mParent->emitResult();
50 collections.prepend( mCollection );
52 foreach (
const Collection &collection, collections ) {
55 mParent->connect( itemFetchJob, SIGNAL(result(KJob*)),
56 mParent, SLOT(itemFetchResult(KJob*)) );
62 void itemFetchResult( KJob *job )
64 if ( !job->error() ) {
67 if ( !mMimeTypes.isEmpty() ) {
68 foreach (
const Item &item, fetchJob->
items() ) {
69 if ( mMimeTypes.contains( item.
mimeType() ) )
73 mItems << fetchJob->
items();
79 if ( mFetchCount == 0 )
80 mParent->emitResult();
87 QStringList mMimeTypes;
93 const QStringList &mimeTypes,
95 : KJob( parent ), d( new Private( collection, mimeTypes, this ) )
111 return d->mFetchScope;
118 if ( !d->mMimeTypes.isEmpty() )
121 connect( job, SIGNAL(result(KJob*)),
this, SLOT(collectionFetchResult(KJob*)) );
129 #include "moc_recursiveitemfetchjob.cpp"
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:27:40 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.