Skip to content
Commit de3cc8dc authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa
Browse files

libarchive: Stop manually handling temporary work files.

Having to call QFile::remove() whenever there is a failure and we want
to get rid of the working file is bad -- for example, we were not
calling it when archive_write_header() failed in deleteFiles() and thus
could end up with a potentially big dangling file.

By using KSaveFile, we solve that problem and also stop using
predictable names for the temporary files we work on when adding and
deleting entries.

Note that we use KSaveFile with Qt5's QSaveFile semantics: instead of
calling finalize() by default, we take the safer approach of calling
abort() instead. This is done by wrapping KSaveFile in a QScopedPointer
and calling abort() in the custom deleter. We then explicitly call
finalize() when we want to.
parent cd9742af
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment