I implemented your plan hopefully the right way. Could you have a look at the patch if this fits to the programming standards?
It works now, but I am unsure if this is the proper way to get the result. Should I rename something?
In case it is well done, I will push my local branch to lp:tomdroid.