Bug Fixes in KDE-PIM
This fixes a crash triggered by a QSortFilterProxyModel on top of this model. It also fixes two issues which have been worked around in the tests.
I have yet failed to write a unit test for the actual issue.
The issue is likely related to what is mentioned in 18dbff53fec936b6ebfe78f3b33c5e82ba8626c5