[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Review Request: Avoid setting a style that is already set
From:       Hans Meine <hans_meine () gmx ! net>
Date:       2010-06-01 13:44:28
Message-ID: 201006011544.30070.hans_meine () gmx ! net
[Download RAW message or body]

On Sunday 30 May 2010 17:37:28 Matthias Fuchs wrote:
> > Christoph Feck wrote:
> >     Matthias, if Qt cannot find any style you have a bigger problem...
> >     
> >     Qt itself does not handle the cases where style is 0, it just uses
> >     style()->pixelMetric() etc. and it would be ridiculous to add a null
> >     check everywhere.
> 
> That argument is ok, but not that Qt asserts anyway because you cannot be
> sure what Qt is compiled like on the user's machine.

Note that that does not matter - the Q_ASSERT() indicates the /basic 
assumption/ that its argument will always hold, irrespective of QT_NO_DEBUG.

It is correct, however, that assertions must not be confused with runtime 
checks.  AFAICS it makes sense to use assertions for checking data coming from 
API clients, i.e. programmers, but not for user data, i.e. data read from 
files.

Have a nice day,
  Hans
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic