Prevent cycle creation at the repository level
ClosedPublic

Authored by ervin on Dec 29 2015, 11:26 AM.

Details

Summary

We do some checking in the presentation layer, but in some views where
items might show up several times the model index based heuristic can't
work. So instead let's make TaskRepository::associate() do all the
checking and return an error when needed.

We should really think about porting the repository tests to the fake
akonadi too.

Diff Detail

Repository
R4 Zanshin
Lint
Lint Skipped
Unit
Unit Tests Skipped
ervin updated this revision to Diff 1661.Dec 29 2015, 11:26 AM
ervin retitled this revision from to Prevent cycle creation at the repository level.
ervin updated this object.
ervin edited the test plan for this revision. (Show Details)
ervin added reviewers: bensi, franckarrecot, dfaure.
dfaure added inline comments.Dec 29 2015, 11:43 AM
src/akonadi/akonaditaskrepository.cpp
220

this should be a multiarg .arg(a,b) to avoid bugs when the title contains "%1".

tests/units/akonadi/akonaditaskrepositorytest.cpp
684

Not testing the return value from exec() ?

ervin updated this revision to Diff 1662.Dec 29 2015, 12:09 PM

Addressing dfaure's comments

ervin marked 2 inline comments as done.Dec 29 2015, 12:10 PM
bensi accepted this revision.Dec 29 2015, 8:10 PM
bensi edited edge metadata.
This revision is now accepted and ready to land.Dec 29 2015, 8:10 PM
ervin updated this revision to Diff 1664.Dec 29 2015, 9:20 PM
ervin edited edge metadata.

Added an extra check on the createTaskFromItem, we could see projects
at that point, which means null task pointer.

This revision was automatically updated to reflect the committed changes.