<br><br><div class="gmail_quote">On Fri, Oct 9, 2009 at 5:08 AM, Cristian Oneţ <span dir="ltr"><<a href="mailto:onet.cristian@gmail.com">onet.cristian@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On Fri, Oct 9, 2009 at 8:36 AM, Thomas Baumgart <<a href="mailto:thb@net-bembel.de">thb@net-bembel.de</a>> wrote:<br>
> Hi,<br>
><br>
> on Thursday 08 October 2009 Cristian Oneţ wrote:<br>
><br>
><br>
>> În data de Miercuri 30 Septembrie 2009 06:02:47 Alvaro Soliverez a scris:<br>
>> > Hello all,<br>
>> > just so you know, using a format with .xml extension results in the Save<br>
>> > command not working.<br>
>> > When you hit save, it seems to work, but if you close and reopen the<br>
>> > file, nothing has been done.<br>
>> > I'm not sure I will have time to look at it soon, so if anybody wants to<br>
>> > jump in, you are welcome.<br>
>> ><br>
>> > Regards,<br>
>> > Alvaro<br>
>><br>
>> I found out so far that the problem is that the KSaveFile is not opened<br>
>> when saving as xml and the file already exists. This causes the save<br>
>> opration to fail. A good place to open the file would be<br>
>> KMyMoneyView::saveFile (do it always) but that seems to brake saving as<br>
>> kmy file. So I'll have to investigate a bit further but if these<br>
>> observations give a clue to those of us who know the application better<br>
>> and they can fix this faster, please do that ;).<br>
><br>
> take a look at kmymoneyview.cpp lines 1127 .. 1163 and compare them against<br>
> the KDE3 version. You can clearly see, that the file is not opened if it<br>
> exists:<br>
><br>
> if(fi.exists()) {<br>
> fmode |= fi.permission(QFile::ReadGroup) ? 040 : 0;<br>
> fmode |= fi.permission(QFile::WriteGroup) ? 020 : 0;<br>
> fmode |= fi.permission(QFile::ReadOther) ? 004 : 0;<br>
> fmode |= fi.permission(QFile::WriteOther) ? 002 : 0;<br>
> if(fi.groupId() != static_cast<uint>(-2))<br>
> gid = fi.groupId();<br>
> } else {<br>
> qfile.open();<br>
> }<br>
><br>
> This is completely different in the KDE3 version. The trick with the basic<br>
> block and the automatic deletion of the KSaveFile object as done in KDE3 does<br>
> not work here anymore. One might use the KSaveFile::finalize() method to close<br>
> the file to be able to change the owner of it.<br>
><br>
> If you don't think you can fix this yourself, please let me know and I'll take<br>
> a look at it next week. Won't have time before.<br>
</div></div>Now I get it. So this was messed up during the 'make it compile on<br>
KDE4' phase. When encountering such problems I always check the KDE3<br>
version to spot possible problems in the differences. I don't know how<br>
I missed this difference, thanks for pointing this out this is the<br>
kind of hint I expected to get after my previous mail :).<br>
<br>
</blockquote></div><br>Ok, so there is some karma in this bug, because it was me porting that part of code, and I got bitten by it. :)<br><br>I remember adding the qfile.open() because if the file does not exist, the subsequent calls wouldn't open automatically like in Qt3. <br>
<br>Why is it that this fails with .xml files, but not with .kmy files?<br><br>Regards,<br>Alvaro<br><br>