--===============7535259898416666237== Content-Type: multipart/signed; boundary="nextPart1707312.c9VpGat2mi"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart1707312.c9VpGat2mi Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Shaheed, On Friday, 2012-01-27, Shaheed Haque wrote: > Hi Kevin, >=20 > Given that I want to do bulk fetches from Exchange, it would be nice > to do bulk writes to Akonadi too. Since all the various Item-related > Job work on single items at a time, I'd like to continue using the > itemsRetrievedIncremental() API. That internally uses item jobs as well IIRC. > So, how about if I rearrange the code > to avoid calling cancelTask, i.e. like this: >=20 [snip code] > IIUC, the context for itemsRetrievedIncremental() will be correct, and > this should be the most efficient way to do it. DOes that sound > plausible? No, that won't work. While not cancelling the tasks keeps it the active=20 context, it also keeps your custom task from being executed. However, since the purpose of custom task right here seems to be calling=20 retrieveGALItems() asynchronously you could do that with=20 QMetaObject::invokeMethod(). retrieveItems() { ... scheduleCustomTask("retrieveGALItems") // Don't cancelTask() , just return. QMetaObject::invokeMethod(this, "retrieveGALItems", Qt::QueuedConnection= ); } retrieveGALItems() { ... fetch 300 items from Exchange itemsRetrievedIncremental(items); if (no more items) { itemsRetrievalDone(); } else { // go around again. QMetaObject::invokeMethod(this, "retrieveGALItems",=20 Qt::QueuedConnection); } } Cheers, Kevin =2D-=20 Kevin Krammer, KDE developer, xdg-utils developer KDE user support, developer mentoring --nextPart1707312.c9VpGat2mi Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iD8DBQBPIvnEnKMhG6pzZJIRAk6XAJ4qoZ/fSI8e7jiFDtHyaHzVVTvN3QCfUNE6 AevKRpfdGdFX7JwsllkIdSY= =YtlK -----END PGP SIGNATURE----- --nextPart1707312.c9VpGat2mi-- --===============7535259898416666237== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ KDE PIM mailing list kde-pim@kde.org https://mail.kde.org/mailman/listinfo/kde-pim KDE PIM home page at http://pim.kde.org/ --===============7535259898416666237==--