<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Dec 2, 2013 at 10:31 PM, Dominik Haumann <span dir="ltr"><<a href="mailto:dhaumann@kde.org" target="_blank">dhaumann@kde.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
porting KSaveFile to QSaveFile, I stumbled into the following:<br>
<br>
// This method has been made private so that it cannot be called,<br>
// in order to prevent mistakes.<br>
void QSaveFile::close()<br>
{<br>
    qFatal("QSaveFile::close called");<br>
}<br>
<br>
In Kate, we use a QSaveFile saveFile(...); and then use<br>
<br>
  KCompressionDevice compDevice(&saveFile, ...);<br>
<br>
to write compressed data through compDevice into saveFile.<br>
<br>
However, KCompressionDevice at some point always seems to call close(), which<br>
hits the qFatal().<br>
<br>
Should I derive from QSaveFile and overwrite close() to call commit() ?<br>
Am I missing something here?<br>
<br>
Greetings,<br>
Dominik<br>
_______________________________________________<br>
Kde-frameworks-devel mailing list<br>
<a href="mailto:Kde-frameworks-devel@kde.org">Kde-frameworks-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kde-frameworks-devel" target="_blank">https://mail.kde.org/mailman/listinfo/kde-frameworks-devel</a><br>
</blockquote></div><br></div><div class="gmail_extra">Looks to me like it's either a bug on KCompressionDevice or QSaveFile. Personally, I think it's rather odd that some public API call invariably crashes (it's made private in QSaveFile, but it's still public on the parent, so it's not very useful).</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">I'd say that this fix should go to Qt, but David will probably have a better insight.</div><div class="gmail_extra">Mr Faure? :D</div><div class="gmail_extra">

<br></div><div class="gmail_extra">Aleix</div><div class="gmail_extra"><br></div></div>