[Kde-games-devel] Indentation of KGoldrunner re-done

Luciano Montanaro mikelima at gmail.com
Fri Jan 25 08:22:58 CET 2008


Il Friday 25 January 2008 07:27:01 Ian Wadham ha scritto:
> Hello everybody,
>
> I have just done a major re-indentation of all *.h and *.cpp
> files in KGoldrunner, revision 766061.  So if you are planning
> to make any changes to KGoldrunner code, please do SVN
> update first.

Oops! Too late. :)

Yesterday I have worked on letting the themes specify multiple tiles per each 
role -- it would be possible to have a few variations of brick, concrete pole 
and ladder, which are then used in a pseudorandom distribution on the map.

There is an outstanding issue, which is that changing theme from one that has 
more tiles to one that has fewer does not work -- I'd have to reload the 
level data to do so...

Anyway, I'll continue on my local repository until things are stable, then 
update from head and deal with the conflicts.

> The new code has no differences to the old, 
> using diff -wb, but I did find one bug even after that, so
> please keep an eye out for any strange occurrences and let
> me know, e.g. by private email, rather than a bug report.
>

Does it have anything to do with not being able to start from a level 
different from 14? Otherwise, I have introduced a problem... it would be 
strange, because I did not touch anything outside kgrtheme, kgrcanvas and 
kgrplayfield...

> The new indentation is in steps of four spaces, with NO tabs,
> which I understand is the KDE preference.  Tabs can still occur
> after the first non-whitespace character in a line, e.g. before
> comments at the end of a line - and this is intentional.  Other
> little adjustments are:
>
>    - "{" on same line as "if", "while", "switch" or "for", if possible,
>    - lines limited to 80 chars, if possible (changes not finished yet),
>    - no "cuddled else" (i.e. not like "} else {"): I prefer "}\n    else
> {", - "fn (abc)" is preferred, i.e. space after "fn" and none after "(", -
> functions with no arguments preferred as "fn()", with no space, - no spaces
> either side of "::", e.g. "KGrGame::showHint()".
>

Ok, I'll check for my changes to adhere to the above.

> Here's hoping you will all find the new code easier to read.  The
> old code was really a mess.
>

OK. I have seen other KDE subprojects having a HACKING file containing the 
preferred style guidelines. WE could have the same there for reference...

Ciao, 
Luciano



More information about the kde-games-devel mailing list