[Kde-pim] ItemFetchJob - Only fetching items which have a payload
Vishesh Handa
me at vhanda.in
Thu May 23 19:19:00 BST 2013
Hey guys
In the Akonadi Nepomuk Feeder we have this ItemFetchJob which fetches all
the items in a collection, and then sends them for indexing if they aren't
already indexed.
The problem is that many of these items often do not have a payload, so
when we try to fetch the payload in order to index its contents, the fetch
fails. This skews the progress and results in the akonadi feeder attempting
to fetch a large number of payload-less items on startup.
Is there any way to only fetch the items which have a payload in a cache,
but not fetch the actual payload?
The relevant code is
kdepim-runtime/agents/nepomukfeeder/findunindexeditemsjob.cpp
const Akonadi::Collection col = mIndexedCollections.takeLast();
Akonadi::ItemFetchJob *fetchJob = new Akonadi::ItemFetchJob(col, this);
fetchJob->fetchScope().fetchAllAttributes(false);
fetchJob->fetchScope().fetchFullPayload(false);
fetchJob->fetchScope().setFetchModificationTime(true);
connect(fetchJob, SIGNAL(itemsReceived(Akonadi::Item::List)), this,
SLOT(itemsReceived(Akonadi::Item::List)));
connect(fetchJob, SIGNAL(result(KJob*)), this, SLOT(jobDone(KJob*)));
--
Vishesh Handa
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list