Port KAnimatedSystemTray into KSystemTray

Alex Merry kde at randomguy3.me.uk
Sat Sep 13 22:49:30 BST 2008


On Saturday 13 September 2008 21:01:42 Friedrich W. H. Kossebau wrote:
> > +    if (d->movie->state() == QMovie::Running) {
> > +        return true;
> > +    } else {
> > +        return false;
> > +    }
>
> (Hm. Really, how is this better? But this is OT these days).

There is really only one specific style guideline that I think there is an 
objective reason for: putting braces round one-liners.  The reason being that 
it's easier to stumble into the trap of adding a line to one of the clauses 
that does the wrong thing if you don't:

if (condition)
    new line;
    old line;

This does not do what was (probably) intended.  Yes, you _should_ notice that 
when you write it, but then we _should_ write bug-free code.

Personally, I think that most of the rest of any style guide is unimportant as 
long as (a) code is clear and (b) it is consistent within a file.

Alex


PS: the only other things I have any preference on are spaces instead of tabs 
(but only for the reason Thiago voiced earlier on k-c-d about editors not 
distinguishing between indenting and aligning) and putting * or & with the 
type not the variable name, since it's a description of the type (although 
even that is inconsistent because of a peculiar c-ism when declaring multiple 
pointers in the same declaration).


-- 
Proud KDE hacker: http://www.kde.org
Get KDE 4.1 - out now!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080913/95002a59/attachment.sig>


More information about the kde-core-devel mailing list