Skip to content

Draft: feat: restart Krita

Lussandre Lederrey requested to merge edmoneonefive/krita:master into master

I added a way to restart Krita easily. It is located in the File menu, or via the shortcut Ctrl+Alt+R.
Originally I was asked by my school to write a plugin for Krita, and to load a plugin you have to... restart Krita. So my plugin did just that, and when I was asked to write a feature/correct a bug I did the same thing.
It does the same thing as quitting Krita (checks if a document isn't saved and proposes to save it, also the Cancel button avoid to restart) + runs the app back from its location + launch arguments.

Known issues :

  • When restarting, some things might get lost (ex locale, it gets set to English by default)
  • If you're running krita from the command line, the output stays sent to stdout even after being restarted and it appears like you have the terminal's control back. Ctrl+C only stops the output afterwards, not the restarted app.
  • You can see once closed (if you ran from the terminal) some errors :
    • Warning: Some tiles have leaked, I can't seem to figure out why this happens nor if it's related to my feature.
    • Segmentation fault (core dumped), interestingly this only happens after the first restart.
  • Localisation of the button's name isn't done (do I really have to edit the .po files manually ?).
  • Also not an issue but I'm definitely not a C++ pro, so maybe the way I wrote code is awful af, might want to check that as well.

Test Plan

You can build and run Krita and try to restart it either with the action in the File menu, or via the shortcut.

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.
  • Does the patch add a user-visible feature? If yes, is there a documentation MR ready for it at Krita Documentation Repository?

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.

Edited by Lussandre Lederrey

Merge request reports

Loading