Chapter 3. Coding Rules

Table of Contents

Header Files
Source Files

Where-ever possible this document should be referred to when questions regarding the format of the source code are raised.

By the way, we know the code doesn't always conform to the standards at the moment, but work is underway to change the code and all new code submitted should conform to the standards.


The following list shows the general rules that should be regarded by any developer working on KMyMoney.

  • Each file should contain only one declaration or implementation and the filename should reflect the class name. e.g ksomethingdlg.h would contain a declaration for the KSomethingDlg class.

  • A tab width of 2 spaces should be used and if your editor supports it, the tabs should be changed into spaces. (KDevelop/KWrite supports tab translation).

  • All dialogs should be located in the kmymoney2/dialogs directory.

  • Each class should be as self contained as possible. If for instance, you are creating a dialog, then all the signals and slots should be connected within that dialog class. Where access is needed to the class details methods should be used. This enhances readability and makes maintenance a lot easier with each object having it's own state, indentity and behaviour, (see Object Oriented Analysis & Design using UML, Bennet & Co).

  • All user visible text should be wrapped in the i18n internationalisation wrapper for translation.