[Kmymoney-devel] Create new schedule

Cristian Oneţ onet.cristian at gmail.com
Fri Jul 31 08:04:57 CEST 2009


În data de Vineri 31 Iulie 2009 06:19:08 Alvaro Soliverez a scris:
> "when creating a new schedule there is a failing assert, something to
> do with a -1 (this also happens in 0.9.3-CVS I think)"
>
> I tracked this down to a change in Q_ASSERT in Qt4.
> In Qt3, when the condition is false, the warning message gets written to
> standard output and it continues.
> In Qt4, it prints the warning message and calls qFatal(), which exits the
> application with a crash.
>
> Momentarily, I changed it to a qWarning(), but we should review what is
> best in these cases.
>
> Also, in this case, having fraction == -1 is valid, because a new schedule
> gets assigned an empty MyMoneyAccount(), which has no fraction and it
> defaults to -1. Later on, when the user selects an account, the fraction is
> set correctly.
If the value -1 in a valid situation that I think that the Q_ASSERT had not 
place there. Assertions are made on conditions that the developer always 
expects to be true, no matter what, otherwise the program should not work. If 
having fraction == -1 is a valid situation but we, the developers would like 
to have a trace of it, than I thing that a qDebug would be more appropriate 
than the qWarning (if the message of the qWarning gets to the user).

-- 
Regards,

Cristian Oneţ
-------------- 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/20090731/fa4b96e3/attachment.sig 


More information about the KMyMoney-devel mailing list