[Kmymoney-devel] .xml save not working
Thomas Baumgart
thb at net-bembel.de
Fri Oct 9 07:36:11 CEST 2009
Hi,
on Thursday 08 October 2009 Cristian Oneţ wrote:
> În data de Miercuri 30 Septembrie 2009 06:02:47 Alvaro Soliverez a scris:
> > Hello all,
> > just so you know, using a format with .xml extension results in the Save
> > command not working.
> > When you hit save, it seems to work, but if you close and reopen the
> > file, nothing has been done.
> > I'm not sure I will have time to look at it soon, so if anybody wants to
> > jump in, you are welcome.
> >
> > Regards,
> > Alvaro
>
> I found out so far that the problem is that the KSaveFile is not opened
> when saving as xml and the file already exists. This causes the save
> opration to fail. A good place to open the file would be
> KMyMoneyView::saveFile (do it always) but that seems to brake saving as
> kmy file. So I'll have to investigate a bit further but if these
> observations give a clue to those of us who know the application better
> and they can fix this faster, please do that ;).
take a look at kmymoneyview.cpp lines 1127 .. 1163 and compare them against
the KDE3 version. You can clearly see, that the file is not opened if it
exists:
if(fi.exists()) {
fmode |= fi.permission(QFile::ReadGroup) ? 040 : 0;
fmode |= fi.permission(QFile::WriteGroup) ? 020 : 0;
fmode |= fi.permission(QFile::ReadOther) ? 004 : 0;
fmode |= fi.permission(QFile::WriteOther) ? 002 : 0;
if(fi.groupId() != static_cast<uint>(-2))
gid = fi.groupId();
} else {
qfile.open();
}
This is completely different in the KDE3 version. The trick with the basic
block and the automatic deletion of the KSaveFile object as done in KDE3 does
not work here anymore. One might use the KSaveFile::finalize() method to close
the file to be able to change the owner of it.
If you don't think you can fix this yourself, please let me know and I'll take
a look at it next week. Won't have time before.
--
Regards
Thomas Baumgart
GPG-FP: E55E D592 F45F 116B 8429 4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
To the optimist, the glass is half full. To the pessimist,
the glass is half empty. To the engineer, the glass is
twice as big as it needs to be.
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 224 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kmymoney-devel/attachments/20091009/0a858e13/attachment.sig
More information about the KMyMoney-devel
mailing list