Skip to content

Fix dataloss on reordering storyboards

Freya Lupen requested to merge freyalupen/krita:freyalupen/bug-476440 into master

This fixes dataloss on reordering storyboards, a regression of commit 6fe8926c. However, I'm unsure why this change was made or what else it might affect.

BUG:476440

Other notes:

  • Reordering storyboards will log a warning on the first time only:
QObject::connect: Cannot queue arguments of type 'QVector<int>'
(Make sure 'QVector<int>' is registered using qRegisterMetaType().)

It's somehow related to emitting dataChanged in StoryboardModel::setData, but apparently it's unrelated to this bug.

  • The same bugreport also mentions a crash on duplicating storyboards with frozen keyframes. The crash can be avoided with a safe assert in StoryboardModel::getComment
    KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(0 <= row && row < m_commentList.count(), StoryboardComment());

but that doesn't prevent further buggy behavior. The cause of that needs more investigation.

Test Plan

  1. Open the Storyboard Docker, create two storyboard scenes and draw on them.
  2. Drag-and-drop to reorder them. Their thumbnails should not go blank.
  3. Save and reopen the file. It should still contain the frames and not be blank.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.

Merge request reports

Loading