Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.9.0 Beta1
-
None
-
2
Description
The documentation of QTemporaryFile neglects to define the relation between the autoRemove property and the rename() function, specifically whether a rename() will cause autoRemove to be unset or not.
Given that rename() is akin to QSaveFile::commit(), in that it "finishes" the write by (atomically) overwriting the old file with the new temp file, one could be mistakenly assume that a rename() would cancel autoRemove. It looks as though one has to explicitly disable it, though.
The relation between the two should be more explicitly documented, perhaps including a QSaveFile-like example:
- open QTemporaryFile tmp(target), return if failed
- write to tmp, return if failed
- tmp.rename(target), return if failed
- tmp.setAutoRemove(false);
Attachments
Issue Links
- relates to
-
QTBUG-132669 Add a QTemporaryFile/Dir (named?) ctor that doesn't expect a placeholder
-
- Open
-
-
QTBUG-132617 Unclear behaviour of QTemporaryFile::rename()
-
- In Progress
-
-
QTBUG-132620 QSaveFile follows symlinks unconditionally
-
- In Review
-
-
QTBUG-132646 Add a variant of QTemporaryFile::rename() that overwrites
-
- In Review
-