[IncidenceTreeModel] Update UID if it was changed

Authored by poboiko on Mar 30 2020, 1:48 PM.

Description

[IncidenceTreeModel] Update UID if it was changed

Summary:
If one creates a Todo inside KOrganizer, it sets some default generated UID.
Such UID can be changed by the resource afterwards. The model should handle this case.

This patch adds a simple check: if the uid has changed inside `onDataChange, then just update the hashes.

Test Plan:

  1. Add a Todo to Google Tasklist
  2. Add a subtodo instantly (without reloading the view)
  3. (without patch) Subtodo is added at the top level (parent was not recognized)
  4. (with patch) Subtodo is added below the parent todo

Reviewers: dvratil

Subscribers: kde-pim

Tags: KDE PIM

Differential Revision: https://phabricator.kde.org/D28436

Details