Skip to content

Commit

Permalink
update CODING, regenerate t2t, include CODING.html
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jan 25, 2014
1 parent 5a2beb3 commit 6b1bc02
Show file tree
Hide file tree
Showing 6 changed files with 2,025 additions and 156 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ scripts/astyle.exe
*.out *.out
*.tex *.tex
*.toc *.toc
doc/CODING.html
doc/CODING.tex doc/CODING.tex
doc/INSTALL.tex doc/INSTALL.tex
scripts/Debug scripts/Debug
Expand Down
106 changes: 43 additions & 63 deletions CODING
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Developers guide for QGIS
1.3.3. Keyword Substitution 1.3.3. Keyword Substitution
1.4. Variable Names 1.4. Variable Names
1.5. Enumerated Types 1.5. Enumerated Types
1.6. Global Constants 1.6. Global Constants & Macros
1.7. Editing 1.7. Editing
1.7.1. Tabs 1.7.1. Tabs
1.7.2. Indentation 1.7.2. Indentation
Expand All @@ -30,9 +30,8 @@ Developers guide for QGIS
1.9.1. Where-ever Possible Generalize Code 1.9.1. Where-ever Possible Generalize Code
1.9.2. Prefer Having Constants First in Predicates 1.9.2. Prefer Having Constants First in Predicates
1.9.3. Whitespace Can Be Your Friend 1.9.3. Whitespace Can Be Your Friend
1.9.4. Add Trailing Identifying Comments 1.9.4. Use Braces Even for Single Line Statements
1.9.5. Use Braces Even for Single Line Statements 1.9.5. Book recommendations
1.9.6. Book recommendations
2. GIT Access 2. GIT Access
2.1. Installation 2.1. Installation
2.1.1. Install git for GNU/Linux 2.1.1. Install git for GNU/Linux
Expand Down Expand Up @@ -225,16 +224,16 @@ Enumerated types should be named in CamelCase with a leading capital e.g.:
Feet, Feet,
Degrees, Degrees,
UnknownUnit UnknownUnit
} ; };


Do not use generic type names that will conflict with other types. e.g. use Do not use generic type names that will conflict with other types. e.g. use
"UnkownUnit" rather than "Unknown" "UnkownUnit" rather than "Unknown"




1.6. Global Constants 1.6. Global Constants & Macros
===================== ==============================


Global constants should be written in upper case underscore separated e.g.: Global constants and macros should be written in upper case underscore separated e.g.:


const long GEOCRS_ID = 3344; const long GEOCRS_ID = 3344;


Expand All @@ -252,14 +251,21 @@ requirements are met.
Set your editor to emulate tabs with spaces. Tab spacing should be set to 2 Set your editor to emulate tabs with spaces. Tab spacing should be set to 2
spaces. spaces.


Note: In vim this is done with set expandtab ts=2



1.7.2. Indentation 1.7.2. Indentation
================== ==================


Source code should be indented to improve readability. There is a .indent.pro Source code should be indented to improve readability. There is a
file in the QGIS src directory that contains the switches to be used when scripts/prepare-commit.sh that looks up the changed files and reindents them
indenting code using the GNU indent program. If you don't use GNU indent, you using astyle. This should be run before committing. You can also use
should emulate these settings. scripts/astyle.sh to indent individual files.

As newer versions of astyle indent differently than the version used to do a
complete reindentation of the source, the script uses an old astyle version,
that we include in our repository (enable WITH_ASTYLE in cmake to include it in
the build).




1.7.3. Braces 1.7.3. Braces
Expand All @@ -277,37 +283,40 @@ Braces should start on the line following the expression:
... ...
} }


There is a scripts/prepare-commit.sh that looks up the changed files and
reindents them using astyle. This should be run before committing.

As newer versions of astyle indent differently than the version used to do a
complete reindentation of the source, the script uses an old astyle version,
that we include in our repository.



1.8. API Compatibility 1.8. API Compatibility
====================== ======================


From QGIS 1.0 we will provide a stable, backwards compatible API. This will We try to keep the API stable and backwards compatible. Cleanups to the API
provide a stable basis for people to develop against, knowing their code will should be done in a manner similar to the Trolltech developers e.g.
work against any of the 1.x QGIS releases (although recompiling may be
required).Cleanups to the API should be done in a manner similar to the
Trolltech developers e.g.


class Foo class Foo
{ {
public: public:
/** This method will be deprecated, you are encouraged to use /** This method will be deprecated, you are encouraged to use
doSomethingBetter() rather. doSomethingBetter() rather.
@see doSomethingBetter() @deprecated doSomethingBetter()
*/ */
bool doSomething(); Q_DECL_DEPRECATED bool doSomething();


/** Does something a better way. /** Does something a better way.
@note This method was introduced in QGIS version 1.1 @note added in 1.1
*/ */
bool doSomethingBetter(); bool doSomethingBetter();


signal:
/** This signal will be deprecated, you are encouraged to
connect to somethingHappenedBetter() rather.
@deprecated use somethingHappenedBetter()
*/
#ifndef Q_MOC_RUN
Q_DECL_DEPRECATED
#endif
bool somethingHappened();

/** Something happened
@note added in 1.1
bool somethingHappenedBetter();
} }




Expand Down Expand Up @@ -359,29 +368,10 @@ or this:


if ( ! a && b ) if ( ! a && b )



Note: prepare-commit.sh will take care of this.
1.9.4. Add Trailing Identifying Comments
========================================

Adding comments at the end of function, struct and class implementations makes
it easier to find them later.

Consider that you're at the bottom of a source file and need to find a very
long function -- without these kinds of trailing comments you will have to page
up past the body of the function to find its name. Of course this is ok if you
wanted to find the beginning of the function; but what if you were interested
at code near its end? You'd have to page up and then back down again to the
desired part.

e.g.,

void foo::bar()
{
// ... imagine a lot of code here
} // foo::bar()




1.9.5. Use Braces Even for Single Line Statements 1.9.4. Use Braces Even for Single Line Statements
================================================= =================================================


Using braces for code in if/then blocks or similar code structures even for Using braces for code in if/then blocks or similar code structures even for
Expand All @@ -392,7 +382,7 @@ Consider:


if (foo) if (foo)
bar(); bar();
else else
baz(); baz();


Adding code after bar() or baz() without adding enclosing braces would create Adding code after bar() or baz() without adding enclosing braces would create
Expand All @@ -407,11 +397,11 @@ So, prefer this:
} }
else else
{ {
baz(); baz();
} }




1.9.6. Book recommendations 1.9.5. Book recommendations
=========================== ===========================


- Effective C++ (http://www.awprofessional.com/title/0321334876), Scott Meyers - Effective C++ (http://www.awprofessional.com/title/0321334876), Scott Meyers
Expand Down Expand Up @@ -444,7 +434,7 @@ Debian based distro users can do:
2.1.2. Install git for Windows 2.1.2. Install git for Windows
============================== ==============================


Windows users can obtain msys git (http://code.google.com/p/msysgit/). Windows users can obtain msys git (http://code.google.com/p/msysgit/) or use git distributed with cygwin (http://cygwin.com).




2.1.3. Install git for OSX 2.1.3. Install git for OSX
Expand Down Expand Up @@ -1448,7 +1438,7 @@ guidelines are followed in layout and design of GUIs.
boxes with only a single widget / item inside. boxes with only a single widget / item inside.
2. Capitalise first letter only in labels: 2. Capitalise first letter only in labels:
Labels (and group box labels) should be written as a phrase with leading Labels (and group box labels) should be written as a phrase with leading
capital letter, and all remaing words written with lower case first letters capital letter, and all remaining words written with lower case first letters
3. Do not end labels for widgets or group boxes with a colon: 3. Do not end labels for widgets or group boxes with a colon:
Adding a colon causes visual noise and does not impart additional meaning, Adding a colon causes visual noise and does not impart additional meaning,
so don't use them. An exception to this rule is when you have two labels next so don't use them. An exception to this rule is when you have two labels next
Expand Down Expand Up @@ -1491,13 +1481,3 @@ guidelines are followed in layout and design of GUIs.
- Gary Sherman - Gary Sherman
- Marco Hugentobler - Marco Hugentobler


Original pages from wiki to deprecate:

- http://wiki.qgis.org/qgiswiki/CodingGuidelines (./)
- http://wiki.qgis.org/qgiswiki/CodingStandards (./)
- http://wiki.qgis.org/qgiswiki/UsingSubversion (./)
- http://www.qgis.org/wiki/How_to_debug_QGIS_Plugins
- http://wiki.qgis.org/qgiswiki/DevelopmentInBranches (./)
- http://wiki.qgis.org/qgiswiki/SubmittingPatchesAndSvnAccess (./)


21 changes: 10 additions & 11 deletions INSTALL
Original file line number Original file line Diff line number Diff line change
@@ -1,10 +1,10 @@
QGIS QGIS
Building QGIS from source - step by step Building QGIS from source - step by step
Saturday November 30, 2013 Saturday January 25, 2014




Last Updated: Saturday November 30, 2013 Last Updated: Saturday January 25, 2014
Last Change : Saturday November 30, 2013 Last Change : Thursday November 21, 2013




1. Introduction 1. Introduction
Expand Down Expand Up @@ -167,14 +167,13 @@ Now update your local sources database:
=============================== ===============================


|| Distribution | install command for packages | || Distribution | install command for packages |
| lucid | ``apt-get install bison cmake doxygen flex git-core graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libpq-dev libproj-dev libqt4-dev libqwt5-qt4-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-base xvfb`` | | precise | ``apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl0-dev libopenscenegraph-dev libosgearth-dev libpq-dev libproj-dev libqt4-dev libqt4-opengl-dev libqtwebkit-dev libqwt5-qt4-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb`` |
| maverick | ``apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libpq-dev libproj-dev libqt4-dev libqtwebkit-dev libqwt5-qt4-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-base xvfb`` | | quantal | ``apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libopenscenegraph-dev libosgearth-dev libpq-dev libproj-dev libqt4-dev libqt4-opengl-dev libqtwebkit-dev libqwt-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb`` |
| natty | ``apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libpq-dev libproj-dev libqt4-dev libqtwebkit-dev libqwt5-qt4-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-base xvfb`` | | raring | ``apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl0-dev libopenscenegraph-dev libosgearth-dev libpq-dev libproj-dev libpython2.7-dev libqt4-dev libqt4-opengl-dev libqtwebkit-dev libqwt5-qt4-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb`` |
| oneiric | ``apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libpq-dev libproj-dev libqt4-dev libqtwebkit-dev libqwt5-qt4-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-base xvfb`` | | saucy | ``apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl0-dev libopenscenegraph-dev libosgearth-dev libpq-dev libproj-dev libpython2.7-dev libqt4-dev libqt4-opengl-dev libqtwebkit-dev libqwt5-qt4-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb`` |
| precise | ``apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libopenscenegraph-dev libosgearth-dev libpq-dev libproj-dev libqt4-dev libqt4-opengl-dev libqtwebkit-dev libqwt5-qt4-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-base xvfb`` | | wheezy | ``apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libopenscenegraph-dev libosgearth-dev libpq-dev libproj-dev libqt4-dev libqt4-opengl-dev libqtwebkit-dev libqwt-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb`` |
| sid | ``apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libopenscenegraph-dev libosgearth-dev libpq-dev libproj-dev libqt4-dev libqt4-opengl-dev libqtwebkit-dev libqwt-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-base xvfb`` | | jessie | ``apt-get install bison cmake flex grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libpq-dev libproj-dev libqt4-dev libqt4-opengl-dev libqtwebkit-dev libqwt-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev`` |
| squeeze | ``apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libpq-dev libproj-dev libqt4-dev libqwt5-qt4-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-base xvfb`` | | sid | ``apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl0-dev libopenscenegraph-dev libosgearth-dev libpq-dev libproj-dev libqt4-dev libqt4-opengl-dev libqtwebkit-dev libqwt-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python-all python-all-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb`` |
| wheezy | ``apt-get install bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libopenscenegraph-dev libosgearth-dev libpq-dev libproj-dev libqt4-dev libqt4-opengl-dev libqtwebkit-dev libqwt-dev libspatialindex-dev libspatialite-dev libsqlite3-dev pkg-config pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev txt2tags xauth xfonts-base xvfb`` |


(extracted from the respective control files in debian/) (extracted from the respective control files in debian/)


Expand Down
Loading

0 comments on commit 6b1bc02

Please sign in to comment.