Skip to content

Draft: Update several references to deprecated symbols

This MR replaces several references to deprecated symbols in QFileDialog and KMessageBox.

  • QFileDialog::DirectoryOnly is deprecated since Qt 4.5 in favor of QFileDialog::Directory and setOption(QFileDialog::ShowDirsOnly, true).
  • KMessageBox::sorry() is deprecated since Frameworks v5.97 in favor of KMessageBox::error().
  • KMessageBox::{question,warning}YesNo() are deprecated since KDE Frameworks v5.100 in favor of KMessageBox::{question,warning}TwoOptions(). This is part of a move toward using "action verbs" instead of yes/no options.

I also found a bug in the calligraphy profile saving mechanism, so I included a patch for that.

(Edit: The calligraphy bug fix was moved to !2035 (merged))

Question

The KMessageBox changes need a minimum Frameworks version of 5.100 instead of the current 5.44. Should I #if the new symbols for older builds, or should I move those changes to a new MR?

Test Plan

Each reference update is isolated and corresponds to one specific dialog displayed by the UI. The easiest testing strategy is to trigger each dialog and verify it is displayed correctly and that each button behaves as expected.

The calligraphy profile saving bug fix can be testing by attempting to save a new profile named "Current". This should fail, and the user should be prompted with an error message followed by a dialog requesting a new name. After entering a valid name, the profile should be saved normally, and no extra dialogs should appear.

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.

Edited by Quytelda Kahja

Merge request reports