Skip to content

Reset metadata on new document from template

Stephen Wilson requested to merge zeragamba/krita:fix-template-meta into master

This 1.5 line change fixes a bug that's been bothering me since the recorder feature was added :P

When creating a new document from a template, the created date, editing time, and revision numbers were not reset. This caused the recorder to always use the same folder when saving snapshots (due to using the creation date timestamp as the identifier).

Bug in bug tracker: https://bugs.kde.org/show_bug.cgi?id=447010

Test Plan

Check template metadata fix

  • Create or use a template to create a new document
  • Select File -> Document Information
  • Observe Created date:
    • 5.1.0 - Date is the same as the creation date of the template
    • w/fix - Date is now the current timestamp

Check Recorder fix

  • Create or use a template to create a new document
  • Open Recorder Docker
  • Start recorder
  • Draw a bit
  • Stop recorder
  • Create new document using same template
  • Start recorder
  • Draw a bit
  • Stop recorder
  • Open recording folder
  • Observe location of snapshots
    • 5.1.0 - Snapshots from both recordings are added to the same directory
    • w/fix - Snapshots are saved to seperate directories

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