Warning, /network/telepathy-logger-qt/HACKING is written in an unsupported language. File is not indexed.
0001 Contents: 0002 0003 • Version control 0004 • Short version 0005 • Coding style... 0006 › ...for C++ code 0007 › ...for C and Python code 0008 • Submitting patches 0009 0010 =============================================================================== 0011 Version control 0012 =============================================================================== 0013 0014 The current development version of QTpLogger is available from a scratch repo: 0015 0016 <http://quickgit.kde.org/?p=scratch%2Fsanfilippo%2Ftelepathy-logger-query.git&a=summary> 0017 0018 =============================================================================== 0019 Short version 0020 =============================================================================== 0021 0022 QTpLogger follows the same conventions as Tp-Qt4 and Qt itself. 0023 0024 =============================================================================== 0025 Coding style 0026 =============================================================================== 0027 0028 For C++ code: 0029 ------------- 0030 0031 QTpLogger uses the standard Qt4 coding style for the Qt/C++ code, as also 0032 followed by eg. KDELibs. The coding style is described in more detail in the 0033 KDE TechBase at <http://techbase.kde.org/Policies/Kdelibs_Coding_Style>; in 0034 short, it amounts to: 0035 0036 * 4 spaces for indentation (no tabs, anywhere) 0037 * javaCase for variables and functions (incl. members), FullCamelCase for types 0038 * No abbreviations, except for 100% standard ones like regex, refcount, etc. 0039 * Type &var and Type *var, not Type& var and Type* var for pointers and refs 0040 * Use only one empty line to separate both groups of related statements AND 0041 function & class bodies 0042 * Use a space after each keyword but none after opening parens (if (true)) 0043 * No spaces between the function name and the parens for the parameter list 0044 * Surround binary operators with spaces, but don't put spaces between a unary 0045 operator and their operand 0046 * For function bodies, put the opening curly brace on its own line. For 0047 everything else, put the opening curly brace in the same line as the 0048 statement (if, for, etc.) associated with it. 0049 * Use curly braces even for single-line bodies of conditional statements and 0050 loops 0051 * Prefer static_cast, const_cast etc over C-style casts 0052 * Wrap long lines to 100 characters at most 0053 * Use foreach, emit instead of Q_FOREACH/Q_EMIT 0054 * Don't write long (> ~5 lines) inline methods unless they are needed because of 0055 eg. template 0056 * Don't use references to QObjects 0057 * Destroy transient objects such as method call watchers as soon as possible 0058 rather than accumulating them to long-lived parent objects 0059 * Documentation should be in the source file instead of the header file 0060 * Public xxxInterface methods' definitions should be added to the end of the 0061 public methods declaration. 0062 * Always add friend struct Private declaration on classes that have Private 0063 structure. 0064 * Always add Q_DISABLE_COPY(xxx) to classes that cannot be copied. 0065 * Q_DISABLE_COPY(xxx) declaration must be placed on the top of the class 0066 definition, before the public keyword. 0067 * Methods should be ordered as follows: 0068 public 0069 public Q_SLOTS 0070 Q_SIGNALS 0071 protected 0072 protected Q_SLOTS 0073 private Q_SLOTS 0074 private 0075 * friend class xxx definitions must be placed right below the private keyword. 0076 0077 =============================================================================== 0078 Submitting patches 0079 =============================================================================== 0080 0081 Patches should be made as (preferably) git branches or (last resort) -uNr diffs 0082 against upstream git master, as found at git repos stated above. 0083 0084 Patches can be announced at the kde-telepathy mailing list, for the moment. 0085 We'll move to bugzilla very soon. 0086 0087 If submitting a Git branch, please set the URL field of the bug to point to 0088 your Git branch. Regardless of whether you are referring to a Git branch or 0089 attaching patches, please specify the "patch" keyword on the bug. 0090 0091 For details on the code review procedure, see: 0092 0093 http://telepathy.freedesktop.org/wiki/Review%20Procedure