Avoid duplicated tasks in Context pages
ClosedPublic

Authored by ervin on Jul 26 2017, 10:11 AM.

Details

Summary

We now use the cache in order to check if a task tagged with the current
context also has a parent tagged in that same context. In that case we
don't need it as top level since it'll be brought up again by its
parent.

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.Jul 26 2017, 10:11 AM
bensi accepted this revision.Jul 30 2017, 8:23 AM
This revision is now accepted and ready to land.Jul 30 2017, 8:23 AM
dfaure requested changes to this revision.Aug 2 2017, 7:31 AM
dfaure added inline comments.
tests/units/akonadi/akonadicontextqueriestest.cpp
272

But if the first call to findTopLevelTasks returns garbage, we won't find out. Maybe this should be inside a for (int i = 0; i < 2; ++i) if you want to check that calling it twice works and returns the right result both times? (all the QCOMPARE and stuff being inside the for loop).
But maybe I'm missing something, seeing how waitForEmptyJobQueue would then be called twice instead of once.

281

Grammar error, I guess you meant "Should not change anything"

This revision now requires changes to proceed.Aug 2 2017, 7:31 AM
ervin added inline comments.Aug 2 2017, 6:45 PM
tests/units/akonadi/akonadicontextqueriestest.cpp
272

It's mainly about catching a crash we had way way back on the first queries we implemented. There are other tests where it's called only once so we'd know if that'd return garbage on the first try.

ervin updated this revision to Diff 17599.Aug 2 2017, 6:47 PM
ervin edited edge metadata.

Addressing the grammar error dfaure spotted

dfaure accepted this revision.Aug 2 2017, 8:42 PM
This revision is now accepted and ready to land.Aug 2 2017, 8:42 PM
This revision was automatically updated to reflect the committed changes.