Debian Codegraph @

DESIGN

raw
1 If you add a major new feature, suggest using it in
2 https://develop.kde.org/docs/features/configuration/introduction/
3
4 kconfigdata_p.h contains definitions of the data formats used by kconfig.
5
6 Configuration entries are stored as "KEntry". They are indexed with "KEntryKey".
7 The primary store is a "KEntryMap" which is defined as a std::map from "KEntryKey"
8 to "KEntry"
9
10 KEntry's are stored in order in the KEntryMap. The most significant sort
11 criteria is mGroup. This means that all entries who belong in the same group,
12 are grouped in the std::map as well.
13
14 The start of a group is indicated with a KEntryKey with an empty mKey and a
15 dummy KEntry. This allows us to search for the start of the group and then to
16 iterate until we end up in another group. That way we will find all entries
17 of a certain group.
18
19 Entries that are localised with the _current_ locale are stored with bLocal
20 set to true. Entries that are localised with another locale are either not
21 stored at all (default), or with the localization as part of the key and bRaw
22 set to true (when reading a file in order to merge it).
23
24 Entries that are being read from a location other than the location to
25 which is written back are marked as "default" and will be added both as
26 normal entry as well as an entry with the key marked as default.
27
28 When the configuration is synced to disk, the current on-disk state is re-read
29 into a temporary map, updated with dirty (modified) entries from the
30 current config object's entry map and then written back.
31
32
33 Note that there is a subtle difference between revertToDefault() and deleteEntry().
34 revertToDefault() will change the entry to the default value set by the system
35 administrator (Via e.g. $KDEDIR/share/config) or, if no such default was set,
36 non-existent.
37 deleteEntry() will make the entry non-existent. If if the system administrator
38 has specified a default value, the local entry is marked with [$d].
39
40 Entries are marked "immutable" if the key is followed by [$i] (e.g. 'key[$i]=value');
41 groups are marked "immutable" if the group is followed by [$i] (.e.g '[GroupName][$i]').
42 An "immutable" entry/group cannot be overriden by the user.
43
44 For more details see docs/options.md.
45
46
47 ------------------------------------------------------------------------------
48
49 KConfig XT
50 ==========
51
52 My buzzword picker offered KConfig XT ("eXtended Technology") and KConfig NG
53 ("Next Generation"). Since the planned changes are meant to be evolutionary
54 rather than revolutionary, KConfig NG was dropped.
55
56 Goals
57 =====
58
59 * Have the default value for config entries defined in 1 place. Currently it is
60 not uncommon to have them defined in three places:
61 1) In the application that reads the setting in order to use it
62 2) In the settings dialog when reading the setting
63 3) In the settings dialog when selecting "Use defaults".
64
65 * Provide type-information about config entries to facilate "KConfEdit" like
66 tools. Ideally type-information also includes range-information; this is even
67 mandatory if enums become an explicit type.
68
69 * Facilitate the documentation of config entries.
70
71 KCoreConfigSkeleton
72 |
73 v
74 KConfigSkeleton /--< myapp.kcfg
75 | /
76 |*---------------<
77 |kconfig_compiler \
78 | \--< myconfig.kcfgc
79 v
80 MyConfig <-----KConfigDialogManager----> MyConfigWidget *---< myconfigwidget.ui
81 uic
82
83 KCoreConfigSkeleton/ base class for deriving classes that store application
84 KConfigSkeleton: specific options providing type-safety and single-point
85 defaults.
86
87 MyConfig: An application specific class that offers configuration options
88 to the applications via variables or accessor functions and that
89 handles type-safety and defaults. MyConfig is just an example
90 name, the application developer choses the actual name.
91
92 myapp.kcfg: File describing the configuration options used by a specific
93 application. myapp.kcfg is just an example name, the application
94 developer choses the actual name.
95
96 myconfig.kcfgc: Implementation specific code generation instructions
97 for the MyConfig class. myconfig.kcfgc is
98 just an example name, the application developer
99 choses the actual name.
100
101 KConfigDialogManager: Class that links widgets in a dialog up with their
102 corresponding configuration options in a configuration
103 object derived from KConfigSkeleton.
104
105 MyConfigWidget: Dialog generated from a .ui description file. Widget names
106 in the dialog that start with "kcfg_" refer to configuration
107 options.
108
109 See http://techbase.kde.org/Development/Tutorials/Using_KConfig_XT