You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Save into a directory where you do not have write permission. (In Linux, I used /usr/test.scd.) It will look like the document saved without error.
Check the file: File.exists("/usr/test.scd") -- returns false.
Observed by another user in Windows. I confirmed that it's the same in Linux.
Expected vs. actual behavior
Expected: Common practice for file saving is to report errors to the user, in a pop-up box.
Actual: The user gets no feedback that saving failed -- and will likely assume that the file was saved, leading to loss of code when the user finds otherwise.
The text was updated successfully, but these errors were encountered:
not good. looks like in DocumentManager::doSaveAs, we do detect if file writing failed, but the only feedback is a debug message printed to stderr:
QFile file(path);
if(!file.open(QIODevice::WriteOnly)) {
qWarning() << "DocumentManager: the file" << path << "could not be opened for writing.";
returnfalse;
}
DocumentManager::doSaveAs and returns a boolean that indicates whether saving was successful. so does MainWindow::save. however, the methods MainWindow::saveDocument and MainWindow::saveDocumentAs do not provide any user feedback if saving failed. MainWindow::save does detect for a few problematic file-saving cases like the cases where a file itself is not writable, but it only asks for permission, never forgiveness -- so any failure that we didn't anticipate is silently ignored. luckily the fix seems simple. not so simple is refactoring the saving code so that it's not all 90% awkwardly stuffed in MainWindow::save.
Environment
Steps to reproduce
/usr/test.scd
.) It will look like the document saved without error.File.exists("/usr/test.scd")
-- returns false.Observed by another user in Windows. I confirmed that it's the same in Linux.
Expected vs. actual behavior
Expected: Common practice for file saving is to report errors to the user, in a pop-up box.
Actual: The user gets no feedback that saving failed -- and will likely assume that the file was saved, leading to loss of code when the user finds otherwise.
The text was updated successfully, but these errors were encountered: