Hi all,
I use QuaZip to process ZIP archives. Eventually I have to write new archives to disc, and make absolutely sure of success before I proceed. As I understand, from Qt 5.1, QSaveFile is intended to accomplish this. This stackoverflow post suggests that QSaveFile indeed implicitly ensures the file is synced to disc.
Now, though I do question some of QSaveFile's design decisions, this post is about pragmatic solutions.
I am looking for a way - with as little effort as possible- to safely write a QuaZip to disc. QuaZip does provide a ctor that takes a QIODevice. However, as the QuaZip::close() docs state:
QSaveFile not only overrides access to close() as private, but also does this:The underlying QIODevice is also closed, regardless of whether it was set explicitly or not.
which crashes my appplication when QuaZip::close() implicitly calls QIODevice::close() on the QSaveFile.Qt Code:
/*! \reimp Cannot be called. Call commit() instead. */ void QSaveFile::close() { qFatal("QSaveFile::close called"); }To copy to clipboard, switch view to plain text mode
Any suggestions appreciated.
Bookmarks