Editor model: fix race between editing and notification-after-saving.

Authored by dfaure on Nov 23 2016, 10:06 PM.

Description

Editor model: fix race between editing and notification-after-saving.

Summary:
Don't replace text being edited by the user with older text coming
from akonadi notifications. This means tracking whether the editor
has focus or not, since we still want it to react to the notification
that the title has changed when renaming an item in the central list.

This fixes the cursor jumping back to position 0 while editing,
and the occasional loss of characters.

This change also allows to get rid of the libical whitespace workaround.
Now the libical issue is only visible when leaving a trailing whitespace,
switching tasks and back, and the whitespace is gone => no big deal.

Test Plan:
The related feature tests I added recently still pass.
Editing in zanshin doesn't exhibit the race anymore.

Reviewers: ervin

Reviewed By: ervin

Subscribers: Zanshin

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