readEntry and booleans
Olivier Goffart
ogoffart at kde.org
Thu Jan 5 12:14:00 GMT 2006
Le Jeudi 5 Janvier 2006 10:42, David Faure a écrit :
> On Wednesday 04 January 2006 21:34, Thomas Braxton wrote:
> > forgot to attach the diffs :)
> > in the second diff kconfigtest issues a warning about loss of information
> > instead of crashing.
>
> In general I don't like to bring crashes onto users; but in this case I
> fail to see how application code could use the right types most of the
> times and incompatible types now and then; it would have to be pretty
> generic code to end up doing that.... So IMHO the Q_ASSERT is fine, to
> catch such an unlikely programming error early. Adding the warning in
> addition can't hurt, for the release case :)
If the application is compiled without debug, Q_ASSERT is something like
#define Q_ASSERT( COND ) do{}while(0)
So it's not for user, but for developper.
Anyway, i'm used to use application i develop, and i don't like when it crash,
like all theses Q_ASSERT that occur now with QList
i'd maybe do a
#define K_ASSERT( COND ) if(!COND){KMessageBox::error("ASSERT at line %1 of
file %2: backtrace: %3");}
Which has the benefit to force the user that use the program for debogging to
see there is a problem (kdWarning is often not seen because konsole beging
spammed with normal kdDebug)
And let that user continue to use the application, and not loss data if any.
do you think it is a good idea ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060105/530babbd/attachment.sig>
More information about the kde-core-devel
mailing list