[Kmymoney-devel] [Bug 207354] Crash creating a new account

Cristian Oneţ onet.cristian at gmail.com
Sat Sep 26 12:28:42 CEST 2009


În data de Sîmbătă 26 Septembrie 2009 00:07:31 ați scris:
> În data de Joi 24 Septembrie 2009 16:15:08 Thomas Baumgart a scris:
> > On Thursday 24 September 2009 14:49:30 Alvaro Soliverez wrote:
> > > Cristian,
> > > can you take a look at this bug?
> > > I still have limited debugging capabilities on my sandbox. I have to
> > > sit down and reinstall the whole development environment.
> > >
> > > There should be somewhere in the newuserwizard where firstTimeRun is
> > > set to true before time.
> >
> > That's probably in main.cpp line 273. In case you comment it, the new
> >  wizard will be run again the next time. The flag will be reset in
> >  KMyMoney2App once the new user wizard has completed.
> >
> > This causes other trouble though. If you never finish the new user
> > wizard, you will always start it :(
> >
> > Since I cannot reproduce this problem on the KDE3 version, it could be,
> >  that something else is causing this behavior.  Looks like there is no
> > MyMoneyStorage object available, when the crash happens. Or the
> > currencies are not yet loaded correctly.
> 
> This problem also affects the KDE3 version. It's not crashing but the
>  account will be created without a currency which doesn't make that much
>  sense.
I just wanted to add that the KDE3 version does not crash because operator[]
(i) is called on a QValueList which behaves in the following way:
"It is up to you to check whether this item really exists. You can do that 
easily with the count() function. However this operator does not check whether 
i is in range and will deliver undefined results if it does not exist."

The KDE4 version uses QList for which the operator[](i) has the following 
condition:
"i must be a valid index position in the list"
So that's why it crashed.

> This is what I think that is causing the problems:
> 
> The call to KMyMoneyView::newFile in the constructor of the KMyMoneyView is
> there, I think, from a time when newFile() performed the whole
>  initialisation needed for a correct behaviour. Since now the only thing it
>  does is that it signals that a file is open without doing the proper
>  initialisation of the MyMoneyFile I think that it should be removed (this
>  is what has been done on the KDE4 version - also please see that commit
>  message).
> 
> What are your toughts about the solution?
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kmymoney-devel/attachments/20090926/ff9e8d39/attachment.sig 


More information about the KMyMoney-devel mailing list