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.
Showing with 49 additions and 19 deletions