Consider an editor application implementing its save function such that it instantiates a QSaveFile and gives the user a way to retry with a different name should saving fail (implement a loop using QSaveFile::setFileName() ).
Steps to reproduce:
- Create a file and chmod ugo-w
- Open the editor
- Save, enter new file name
Expected: Saving works
Actual: QSaveFile::write() returns -1, commit fails
This was observed for https://codereview.qt-project.org/c/qt/qttools/+/264690 and a test would look like https://codereview.qt-project.org/c/qt/qtbase/+/267669 .
|For Gerrit Dashboard: QTBUG-77007|
|267669,1||WIP: QSaveFile: Test changing the file name after hitting on readonly file||dev||qt/qtbase||Status: ABANDONED||-2||0|
|267694,5||QSaveFile: Fix changing the file name after hitting on readonly file||5.12||qt/qtbase||Status: MERGED||+2||0|