QSaveFile records past write errors in writeData(), but often the QFileDevice::writeData() calls it places will succeed because the data is only being buffered. Instead, the failures are noticed only by flush(), whose actions do not affect QSaveFilePrivate::writeError. [ChangeLog][QtCore][QSaveFile] Fixed a bug that caused commit() to return true and overwrite its intended target file even though it failed to flush buffered data to the storage, which could cause data loss. This issue can be worked around by calling flush() first and only calling commit() if that returns success. [ChangeLog][QtCore][QSaveFile] Fixed a bug that caused commit() to return true even after a cancelWriting() call had been placed, if writing directly to the target file (that is, only with setDirectWriteFallback() set to true). Note that the state of the file does not change under those conditions, only the value returned by the function. Drive-by clarify a comment from 6bf1674f1e51fd8b08783035cda7493ecd63b44 (Qt 4.6 "Don't drop errors from flush on QFile::close") which had me chasing the wrong lead. Fixes: QTBUG-132332 Pick-to: 6.5 5.15 Change-Id: I427df6fd02132d02be91fffd175579c35b9c06cc Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> (cherry picked from commit 92373d353cf090faa03cbc8aca505d1784b10b54) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 09d44fdef3acf4146a26d6ae757eb2915b29f147) |
||
|---|---|---|
| .. | ||
| auto | ||
| baseline | ||
| benchmarks | ||
| global | ||
| libfuzzer | ||
| manual | ||
| shared | ||
| testserver | ||
| CMakeLists.txt | ||
| README | ||
README
This directory contains autotests and benchmarks based on Qt Test. In order
to run the autotests reliably, you need to configure a desktop to match the
test environment that these tests are written for.
Linux X11:
* The user must be logged in to an active desktop; you can't run the
autotests without a valid DISPLAY that allows X11 connections.
* The tests are run against a KDE3 or KDE4 desktop.
* Window manager uses "click to focus", and not "focus follows mouse". Many
tests move the mouse cursor around and expect this to not affect focus
and activation.
* Disable "click to activate", i.e., when a window is opened, the window
manager should automatically activate it (give it input focus) and not
wait for the user to click the window.