commontk / CTK

A set of common support code for medical imaging, surgical navigation, and related purposes.
https://commontk.org
Apache License 2.0
855 stars 490 forks source link

Add deprecation for ctkDirectoryButton::Option and ctkDirectoryButton::Option enums #1129

Open jcfr opened 1 year ago

jcfr commented 1 year ago

After integrating pull request

We observed that project directly using the enum failed to build:

/path/to/Slicer-Release/Slicer-build/Modules/Scripted/DICOMLib/Widgets/ui_qSlicerDICOMExportDialog.h:185:64: error: ‘ShowDirsOnly’ is not a member of ‘ctkPathLineEdit’
  185 |         PathLineEdit_OutputFolder->setOptions(ctkPathLineEdit::ShowDirsOnly);
      |                                                                ^~~~~~~~~~~~

See https://github.com/Slicer/Slicer/pull/7127#issuecomment-1650958768

Considering that ctkDirectoryButton and ctkPathLineEdit both derive from QWidget and user code may use references to option like ctkPathLineEdit::ShowDirsOnly (instead of QFileDialog::ShowDirsOnly), this was reverted through the integration of:

To support existing use case, the old API should instead be deprecated.