Using KCompressionDevice with QSaveFile

Dominik Haumann dhaumann at kde.org
Mon Dec 2 21:31:43 UTC 2013


Hi,

porting KSaveFile to QSaveFile, I stumbled into the following:

// This method has been made private so that it cannot be called,
// in order to prevent mistakes.
void QSaveFile::close()
{
    qFatal("QSaveFile::close called");
}

In Kate, we use a QSaveFile saveFile(...); and then use

  KCompressionDevice compDevice(&saveFile, ...);

to write compressed data through compDevice into saveFile.

However, KCompressionDevice at some point always seems to call close(), which 
hits the qFatal().

Should I derive from QSaveFile and overwrite close() to call commit() ?
Am I missing something here?

Greetings,
Dominik


More information about the Kde-frameworks-devel mailing list