annotate CODING @ 630:83d3ded39e49

An option to save and restore the last path used was added. This option appears as startup.use_last_path in rc file. Preferences > General > Startup was modified accordingly.
author zas_
date Sun, 11 May 2008 13:14:58 +0000
parents f31ae0d9e163
children f20e7cebcb12
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
524
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
1 Please keep the general coding style of Geeqie:
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
2
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
3 Space after if, while and for:
611
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
4 ------------------------------
524
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
5
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
6 while (...)
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
7 for (...)
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
8 if (...)
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
9
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
10 Indentation of {}:
611
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
11 ------------------
524
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
12
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
13 while (...)
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
14 {
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
15 ...
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
16 }
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
17
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
18 if (...)
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
19 {
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
20 ...
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
21 }
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
22 else
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
23 {
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
24 ...
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
25 }
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
26
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
27 Spaces around operators:
611
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
28 ------------------------
524
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
29
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
30 i = 2;
611
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
31 x = i * (j / 2);
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
32
524
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
33
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
34 Space after comma:
611
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
35 ------------------
524
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
36 func(a, b, c);
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
37
611
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
38 Functions without any parameter should be declared using void:
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
39 --------------------------------------------------------------
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
40 gint function(void)
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
41 {
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
42 ...
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
43 }
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
44
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
45 Use glib types:
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
46 ---------------
524
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
47 Please use glib types when possible (ie. gint and gchar instead of int and char)
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
48 .
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
49
611
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
50 Use glib functions:
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
51 -------------------
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
52 Use glib functions when possible (ie. g_ascii_isspace() instead of isspace()).
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
53 Check if used functions are not deprecated.
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
54
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
55 Others:
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
56 -------
524
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
57 Check twice the indentation and spurious whitespaces.
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
58
611
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
59 Try to use explicit variable and function names.