[Uml-devel] Enforcing some style params (whitespace issue)

Ralf Habacker ralf.habacker at freenet.de
Mon Jun 30 07:56:48 UTC 2008


Gopala Krishna schrieb:
> Hi,
>   I really had a tough time trying to hook my class to umbrello as I
> was trying to play with the deepest base classes - umlwidget.h and
> others.
> This is because there are lots of inconsistencies in whitespace usage.
>
> So i have decided to fix them all with perl one liners.
> The following will be followed ("ws" represents whitespace)
>
> 1) Convert "ws"->"ws"  to just ->
>
> 2) Ensure whitespace after every function/loop/ifconstruct and before
> first opening parenthesis.
>
> 3) Ensure "no" whitespace after opening parenthesis or before closing
> parenthesis.
>
> 4) Finally non whitespace issue. Even i will prefix "get" for my
> methods in my new classes.  Actually i thought of replacing
> "getSomething" with "something" through out umbrello code as this was
> really matter of one liner in perl.
> But then, this can be done later as well and i would like to respect
> your opinion before doing that :-)
>
> I might have done some other similar changes as above which i  might
> have missed now. I hope these changes are acceptable (of course in
> gsoc branch only as of now) :)
>  
>   
Just a hint - For such purposes there are tools like astyle.  
Unfortunally I haven't found any coding style on the umbrello web site.

As a hint kdelibs uses the style defined on 
http://techbase.kde.org/Policies/Kdelibs_Coding_Style which *follows the 
Qt 4 coding style.*

astyle --indent=spaces=4 --brackets=linux \
       --indent-labels --pad=oper --unpad=paren \
       --one-line=keep-statements --convert-tabs \
       --indent-preprocessor \
       `find -type f -name '*.cpp'` `find -type f -name '*.h'`


regards
 Ralf






More information about the umbrello-devel mailing list