[PATCH] Set program icon name by KAboutData

Ingo Klöcker kloecker at kde.org
Sun Apr 20 22:15:02 BST 2008


On Sunday 20 April 2008, Friedrich W. H. Kossebau wrote:
> Am Sonntag, 20. April 2008, um 00:19 Uhr, schrieb Aaron J. Seigo:
> > (and not that it matters *one bit* =) but as i personally like to
> > avoid negatives in conditionals, i'd write it as:
> >
> > if (d->programIconName.isEmpty()) {
> >     return appName();
> > }
> >
> > return d->programIconName;)
>
> I personally even prefer
> 	return d->programIconName.isEmpty() ? appName() :
> d->programIconName;

Then use it. IMO it's better readable than the other two versions 
because it does avoid the asymmetry of one return in the body of an 
if-statement and the other return after the if-statement.

If the longer version is really wanted then I'd write it as

if (d->programIconName.isEmpty()) {
    return appName();
} else {
    return d->programIconName;
}


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080420/4093bb46/attachment.sig>


More information about the kde-core-devel mailing list