Implement caching for the collection fetches
ClosedPublic

Authored by ervin on May 13 2017, 4:03 PM.

Diff Detail

Repository
R4 Zanshin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ervin created this revision.May 13 2017, 4:03 PM
dfaure added inline comments.May 14 2017, 10:14 PM
src/akonadi/akonadicachingstorage.cpp
35

CachingCollectionFetchJob would be a better name, I would think.

56

I'm curious, why did you earlier commit use Q_DECL_OVERRIDE and this one uses override ?

83

I guess this could be a copy_if, to integrate the "<<" that happens below?

120

KCompositeJob's slotResult would do this for you, if this job inherited KCompositeJob.

130

I'm curious, why the explicit detach?

ervin marked 3 inline comments as done.May 15 2017, 2:18 PM
ervin added inline comments.
src/akonadi/akonadicachingstorage.cpp
56

No particular reason apart from reusing code wrote way before 5.7 was around which makes override support necessary. I'm even thinking moving the whole codebase away from Q_DECL_OVERRIDE and Q_NULLPTR at that point. Opinion?

83

Except that copy_if would carry on for the whole collection, I'd rather have it stop iterating at the first matching one, hence the find_if.

130

Left over from a time when I was chasing a ghost.

ervin updated this revision to Diff 14551.May 15 2017, 2:48 PM
ervin marked an inline comment as done.

Address dfaure's comments

ervin updated this revision to Diff 14567.May 15 2017, 8:35 PM

Fixing an indentation issue

bensi accepted this revision.May 16 2017, 7:51 AM
This revision is now accepted and ready to land.May 16 2017, 7:51 AM
dfaure requested changes to this revision.May 21 2017, 12:23 PM
dfaure added inline comments.
src/akonadi/akonadicachingstorage.cpp
121

You forgot to call KCompositeJob::slotResult(kjob) here.

It takes care of setting the error code+text and of calling emitResult().

This revision now requires changes to proceed.May 21 2017, 12:23 PM
ervin updated this revision to Diff 14990.May 30 2017, 4:35 PM
ervin edited edge metadata.

Addressing dfaure's comments

dfaure accepted this revision.May 31 2017, 7:52 AM
This revision is now accepted and ready to land.May 31 2017, 7:52 AM
This revision was automatically updated to reflect the committed changes.