Saving with an existing file name overwrites the file without warning
If a file exists, saving with this existing file name and omitting the extension overwrites the file without warning.
Steps:
1. Create a file and save it.
2. Create a new file and save it using the same file name as the previous, but leave out the file extension.
Result: The second file overwrites the first file without any warning.
Using latest development version 8d4b08d3146a9e81fe61f21b8d0f4937c1947697
Comments
This seems to be a bug in the Qt framework (QFileDialog): if the file name typed in lacks the extension, the Qt dialog does not notice if the file name + the selected file type matches an existing file.
Worth adding ad hoc code? (probably near the end of MuseScore::exportFile() ).
Anybody knows if it has been fixed in Qt 5.x?
M.
I don't think it's a bug (do you have evidence proving the opposite?). The nameFilter in the QFileDialog is only used to filter out which files should be visible. It does not set the file extension. See http://qt-project.org/doc/qt-4.8/qfiledialog.html#setNameFilter
What do you think? I believe an "ad hoc" solution is necessary. I can probably add it myself if I find the time.
The bug happens only on Linux right? Since on Windows and Mac we are using the native dialog.
I don't know. I have only tested on Linux. Can you check on Mac? And Windows?
I can't reproduce on Mac or Windows
Ok. This is related https://bugreports.qt-project.org/browse/QTBUG-11352
So it seems it is not a bug in Qt. I though about extending the QFileDialog by adding a specific check for this case. Any comments on whether this is feasible?
Fixed in 5ebc8d5db2
Automatically closed -- issue fixed for 2 weeks with no activity.