Fix Krita animation timeline cursor duplication
When you create or load an animation and first you click on the headline
of the timeline (the ruler with the frame numbers, not the actual
layers) and drag the cursor, it behaves strangely: the previous cursor
is not erased, and a new duplicate cursor image placed on the touched
frames.
The reason for this: before you click on a layer at least once, the
index structure of the selected row is in invalid status and it returns
-1 for its row() value. So the setCurrentIndex() function cannot replace
the cursor correctly. My solution is used many times elsewhere in the
same source file.
Testplan:
The timeline docker must be visible. Create a new document. Click on the
headline of the timeline (the ruler with the frame numbers) and drag the
cursor. It behaves strangely. If you click on a layer to replace the
cursor, after that the headline also works as expected. My patch fixes
this.
Differential Revision: https://phabricator.kde.org/D1048