Operating system: Windows 10
Slicer version: 4.6.2 and nightly
Expected behavior: Should be able to save scene into “Slicer Data Bundle”
Actual behavior: Fails to save with error message: “Selected directory contains -2 files or directories. Please choose an empty directory.”
qSlicerSceneWriter::writeToDirectory is mostly redundant:
If user saves the scene using the Save data dialog then saving as mrml or mrb should cover all use cases.
For single-click save operation for slicelets/custom applications we typically use applicationLogic.SaveSceneToSlicerDataBundleDirectory (it saves everything to a directory without creating a scene view and without zipping the results; see for example here).
As the method is not really needed, does not work correctly, and it would be difficult to make it robust and efficient (handle non-empty directory, overwriting files with the same name, etc), I think it would be a good idea to remove it (and the corresponding file format) from qSlicerSceneWriter.