[Kmymoney-devel] Create new schedule

Alvaro Soliverez asoliverez at gmail.com
Fri Jul 31 12:21:42 CEST 2009


On Fri, Jul 31, 2009 at 3:04 AM, Cristian Oneţ <onet.cristian at gmail.com>wrote:

> Î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).
>
>
The message goes to the standard output, which the user normally does not
see.
Thomas, should we rather change this into a qDebug?

Anyway, it's good to keep this in mind, because there is a number of
Q_ASSERT around, and now we know its behavior has changed.

Regards,
Alvaro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kmymoney-devel/attachments/20090731/d25e74a7/attachment.htm 


More information about the KMyMoney-devel mailing list