[Kde-pim] Problem with bulk fetching of items with 4.8

Kevin Krammer kevin.krammer at gmx.at
Thu Jan 26 22:52:50 GMT 2012


Hi Shaheed,

On Thursday, 2012-01-26, Shaheed Haque wrote:
> Hi,
> 
> I just upgraded to kde 4.8 etc., and now I'm running into a problem with
> the Exchange Contacts resource (the one in the playground). Basically, the
> problem is that I am trying to retrieve ~467,000 contacts, and so rather
> than the normal scheme of crreating "skeleton" item in retrieveItems(), and
> then fetching the full item in retrieveItem(), I've been creating the full
> item (i.e. with a payload) by kicking off a scheduleCustomTask from
> retrieveItems().

While I don't know what might have changed in the Akonadi libs that causes 
this (Volker might), I'd like to ask what you need the custom task for.

The item retrieval is not bound to the life time of the retrieveItems() call, 
so you could start any operation right in there and just call 
itemRetrievalDone() whenever this (potentially asynchronous) operation is 
done.

See for example the Maildir resource (kdepim-runtime/resources/maildir), which 
starts a KJob based asynchronous operation in its retrieveItems().
This job then adds/modifies/deletes items as required and its result signal 
triggers the call the itemsRetrievalDone(), which ends the retrieveItems task.

Just in case: the same approach also be used with itemsRetrievedIncremental(), 
I used that combination in a smaller resource[1] which repeatedly gets at most 
100 items from a webservice until all are done.

Cheers,
Kevin

[1] https://projects.kde.org/projects/playground/pim/akonadi-
sugarcrm/repository

See the resource and listentriesjob
-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20120126/fcc6a21a/attachment.sig>
-------------- next part --------------
_______________________________________________
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