Details
Description
QDir::tempPath returns the /files directory on Android which should be used for persistent, not for cache (i.e. temp) files.
Note that QStandardPaths::writableLocation returns the correct path.
Also QTemporaryFile is affected by this bug as it uses QDir::tempPath() by default. In case an app is killed by the user when a QTemporaryFile is open, this file will never be cleaned up. If the file is correctly created in the /cache directory, a user might easily remove all those leftovers by clearing all cache (f.ex. when running out of space).
This issue is also discussed on this StackOverflow thread: https://stackoverflow.com/questions/49563420/qdirtemppath-vs-qstandardpathswritablelocation
Attachments
For Gerrit Dashboard: QTBUG-98502 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
432112,3 | Android: Set TMPDIR to point to cache dir rather than a persistent dir | dev | qt/qtbase | Status: MERGED | +2 | 0 |
462749,2 | Android: Set TMPDIR to point to cache dir rather than a persistent dir | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |