[Kde-games-devel] KDE/kdegames/libkdegames

Ian Wadham iandw.au at gmail.com
Thu Nov 26 03:02:34 CET 2009


On Thursday 26 November 2009 8:48:48 am Stefan Majewsky wrote:
> SVN commit 1054334 by majewsky:
> 
> QGraphicsTextItem::setDefaultTextColor does not check whether the given
> color is equal to the color that was previously set, and issues an
> update even then. Because we're calling setDefaultTextColor from the
> item's paint event, this behavior sometimes results in an infinite loop
> paintEvent -> setDefaultTextColor -> update -> paintEvent.
> 
> This commit fixes the weird problem that KGamePopupItem::showMessage
> destroys (on some systems) all running timers.
> 
Well spotted, Stefan!  Nice catch!

Just one niggle, though.

> +    if (textColor != defaultTextColor())
> +        setDefaultTextColor(textColor);
> 
According to http://techbase.kde.org/Policies/Kdelibs_Coding_Style#Braces
the above lines should have braces.

Speaking personally, I prefer to use braces around 1-line conditionals,
because if someone (including me) comes along later and wants to insert
a debug or something, they can not accidentally wreck the program logic.

All the best, Ian W.


More information about the kde-games-devel mailing list