This document describes the recommended coding style for kdepim. Nobody is forced to use this style, but to have consistent formatting of the source code files it is strongly recommended to make use of it.
|In short: Kdepim coding style follows the Kdelibs coding style.|
As discussed at KDEPIM-Treff, Berlin, 3 March 2013, all the files of KDEPIM will be reviewed to follow the coding style. This will be done over a long time, directory after directory, for each of the rules defined above. For each rule, one can find one or two script(s). The first script is to check a single file or a complete directory for all .h and .cpp files.
If present, the second script makes the changes for a single file or a complete directory for all .h and .cpp files. For some complicated situations, the script makes no change.
1 /home/guy-kde/projects/kdepimlibs/ktnef/ktnefparser.cpp 2 1->308: Tab at 16: stream_ >> i; // i <- attribute type & name 3 2->311: Tab at 16: stream_ >> i; // i <- data length 4 3->326: Tab at 22: case attATTACHMENT: // try to get attachment info 5 4->367: Tab at 16: stream_ >> u; // u <- checksum
1 coding-style-check-Trim.sh 2 coding-style-change-Trim.sh
1 coding-style-check-Twice.sh 2 coding-style-change-Twice.sh
The output of the check is:
1 /home/guy-kde/projects/kdepimlibs/syndication/rss2/enclosure.cpp 2 1->25: next empty line found 3 2->26: next empty line found 4 3->30: next empty line found