[Kmymoney-devel] Create new schedule

Thomas Baumgart thb at net-bembel.de
Mon Aug 3 19:30:36 CEST 2009


On Friday 31 July 2009 12:21:42 Alvaro Soliverez wrote:
> 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?

I think it's OK the way it is right now (using the qWarning). 

> 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.

Actually, I expected this to happen in Qt3 already, but it never worked for 
me. At least, the doc somewhere said it would quit in case the assertion 
failed.

-- 

Regards

Thomas Baumgart

GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
If Windows is the answer I want my problem back!
-------------------------------------------------------------
-------------- 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/20090803/b3293721/attachment.sig 


More information about the KMyMoney-devel mailing list