QuaZip creates new file instead of editing it

Hi, I'm writing a Qt application that edits an ods file. I can access content.xml, read it, make the changes that I need on the QDomDocument, but when I save it, it creates a second content.xml file inside the archive. Does anyone know what I'm doing wrong?

This is the relevant part of the code:
1
2
3
4
5
6
7
8
9
10
11
    //WRITING PART
    QuaZip zipOut(filename);
    zipOut.open(QuaZip::mdAdd);
    QuaZipFile fileOut(&zipOut);
    const QuaZipNewInfo* newinfo= new QuaZipNewInfo(info);
    //fileOut.open(QuaZIODevice::WriteOnly,*newinfo);
    fileOut.open(QuaZIODevice::WriteOnly,QuaZipNewInfo(CONTENT_XML));
    fileOut.write(xml.toByteArray());
    fileOut.close();
    zipOut.close();
    delete newinfo;

xml is a QDomDocument
CONTENT_XML is defined as "content.xml"

When I use QuaZip::mdAdd, it creates a new content.xml file
With QuaZip::mdAppend and QuaZip::mdCreate, it deletes all the files in the archive and creates content.xml inside it.
And with QuaZip::mdUnzip, it just won't open the file in WriteOnly.

Well... Found out it's "impossible" right now. (https://sourceforge.net/p/quazip/support-requests/12/). Looks like I'll have to copy every other file to a temporary file and delete/rename.
Topic archived. No new replies allowed.