Warning, /frameworks/kconfig/TODO is written in an unsupported language. File is not indexed.

0001 bugs
0002 ====
0003 
0004 - make expandString stuff consistent
0005 - KConfigGroup::exists() should return true only if the group contains
0006   any non-deleted entries (?)
0007 - immutable groups with no entries are not written out and thus lose
0008   their immutability.
0009 - "C" & "en_US" should be detected early and converted to a null string
0010   (but also save the original string, so locale() semantics don't change
0011   at that point).
0012 
0013 wishes
0014 ======
0015 
0016 - use lazy loading
0017   - load as soon as the first KConfigGroup is instantiated
0018   - lazy parsing of values is interesting, too - see kconfig_take2 branch
0019 - add $\\VAR and $\\(cmd) escapes to list-quote expanded string
0020 - possibly:
0021   - preserve unchanged parts of the config literally. problem: comments
0022     might become stale. so if a comment is already there, add an additional
0023     comment that indicates that the value was changed (include old value?).
0024   - api to actively add comments to files, groups and keys
0025     - option to start these comments with ## as a sign that they should not
0026       trigger the above change indicator logic.
0027   - guaranteeing that write order of new keys is preserved
0028   - detect commented out entries and put actual entries with the same key
0029     right behind them
0030 - possibly: selective multi-level master diversion
0031   - this is to support roaming profiles that have machine/user/etc. specific
0032     settings
0033   - files, groups and keys can have [$m] and [$s] markers; these cascade
0034     within each file only. the least significant object (farthest away from
0035     the master) with an effective $m mode becomes the master (i.e., is
0036     written to and not read past).
0037     default is $m for the master file and $s for the default files.
0038   - the CascadeConfig flag being unset doesn't make things exactly simpler
0039   - can kdeglobals be handled by this?
0040   - does this really make sense? promoting an object to profile wide status
0041     is a conscious decision - which probably needs to be repeated every time
0042     the value changes.
0043 
0044 internals
0045 =========
0046 
0047 - clear up bDeleted vs. isNull in entrymap
0048 - make entrymap truly hierarchical
0049   - an entry map contains its flags, a map of keys and a map of submaps.
0050     it does NOT contain its name and has no parent pointer.
0051   - when creating a kconfiggroup, ask parent for the respective submap
0052     and link it if it is present. if it is not, create one at write op,
0053     link it and tell parent to add it to its entry map. both query and
0054     creation are recursive, obviously.
0055     a kconfiggroup DOES contain its name and has a parent pointer.
0056   - 3)
0057 - 4)
0058 
0059 3)
0060 > We wouldn't have to worry about the KEntryGroup being removed out from
0061 > under us, because the only way that should happen is if the config
0062 > object is destroyed or reparsed, and in those cases you shouldn't be
0063 > using a KConfigGroup from prior to that.
0064 >
0065 i don't think "this is stupid and will not happen" works; [...]
0066 given that cascaded parsing includes writing to existing maps, i think
0067 the simplest approach is clearing the existing structure from keymaps
0068 and resetting the attributes, but leaving the subgroup maps populated,
0069 thus keeping any group refs valid.
0070 the question is about the type of reference held to the entry map.
0071 originally i had thought of pointers. a map would be linked only if it
0072 really existed, otherwise the pointer would be null (thus indicating
0073 reads to return the default immediately and writes to ask the parent to
0074 create a submap). however, keeping that consistent with deletions would
0075 be a nightmare, and with the rescan changing the groups underneath
0076 impossible without each map having a list of referring configgroups.
0077 therefore it might make more sense to always create a corresponding tree
0078 of empty maps when a configroup for a non-existing group is instantiated
0079 - these groups won't be written out (they have no entries and cannot be
0080 immutable) and access to non-existing groups (esp. without an subsequent
0081 write that would actually create it) is rare, so the performance and
0082 memory overhead of this "eager" approach is likely to be negligible. as
0083 a middle way one could use a pointer and lazily populate it on first
0084 access without putting semantics into the pointer being already set,
0085 but i don't think the added complexity will pay off.
0086 
0087 4)
0088 > > > > hmm, wait. maybe it would be better if the map did not do actual
0089 > > > > permission checking. the frontend is peppered with asserts already
0090 > > >
0091 > > > that's the group doing permission checking, if this group is immutable
0092 > > > then the entry can't be changed. plus, now that KEntryKey doesn't know
0093 > > > what group it belongs to KEntryMap can't check if the group is
0094 > > > immutable.
0095 > > >
0096 > > > > (need to consider how to handle release builds). in the backend, the
0097 > > > > ugly immutableGroups hack would be unnecessary.
0098 > > >
0099 > > > no, immutableGroups would still be necessary unless i remove all
0100 > > > checking from KGroupEntry and KEntryMap. but, then checks for
0101 > > > immutable would have to be used everywhere that an entry might be
0102 > > > changed.
0103 > > >
0104 > > yes - and the frontend already handles it and the backend *should*
0105 > > handle it (issue warnings for trying to overwrite $i settings).
0106 >
0107 > i don't know, i think most handling of the immutability of a group
0108 > can/should be handled by the KGroupEntry itself. this way we can keep
0109 > all the data about a group in one place and let KGroupEntry keep
0110 > itself in a consistent/valid state.
0111 >
0112 dunno, either. the use cases are:
0113 - backend: writing immutable objects is fine, as long as the
0114   immutability does not come from a pre-existing default.
0115   given that there will be multiple backends, it sounds like
0116   centralizing the check and warning reporting might make sense. otoh,
0117   such a low-level function might not have enough context to make a
0118   useful message.
0119 - frontend: obviously, writing immutable objects is not permitted. this
0120   is already checked everywhere through asserts. in non-debug builds
0121   these asserts have no effect, but if a write gets that far it means
0122   that the app already permitted changing the option in the first place
0123   due to failure to check for immutability. i don't see much point in
0124   preventing the illegitimate change from being saved, as it can be
0125   repeated anyway (i'm not really convinced of security through
0126   exhaustion/boredom of the attacker :).
0127 i'm not sure whether that means that the two use cases need separate
0128 mutators or whether the mutator should not apply any immutability
0129 semantics at all.
0130 
0131 
0132 overwriting semantics
0133 =====================
0134 
0135 generally:
0136 - localized entries cannot exist without an unlocalized "primary" entry,
0137   so writing a localized key when no corresponding unlocalized key
0138   exists should print a warning and copy the value to the unlocalized
0139   key.
0140 - a primary entry in the user config overshadows not only the immediate
0141   default, but also any localizations of the default. applies also to a
0142   [$d] marker, obviously.
0143   a localized entry in the user config overshadows only that
0144   localization from the default.
0145 
0146 write ops:
0147 > > - writing an entry with the localization flag changes really only that
0148 > >   key.
0149 > >   trying to change the globality of the key prints a warning and does
0150 > >   nothing.
0151 - key exists in local config => overwritten
0152 - key does not exist => created
0153 yes, that's the trivial case.
0154 
0155 > > - writing an entry without the localization flag deletes all
0156 > >   localizations.
0157 > >   in this case, changing the globality of the key poses no problem.
0158 - the key itself is handled trivially
0159 - if localizations exist in the local config, they are actively purged
0160 - localizations in the default config don't matter, as they will be
0161   overshadowed by the unlocalized key in the local config
0162 
0163 > > - deleting an entry also deletes all localizations.
0164 - if default exists, write [$d] entry
0165 - if no default exists, delete entry
0166 - if localizations exist in the local config, they are actively purged
0167 - localizations in the default config don't matter, as they will be
0168   overshadowed by the unlocalized key in the local config (as
0169   localizations cannot exist without a primary key, a deletion marker
0170   key will be present).
0171 
0172 > > - reverting a key to default also restores all localizations.
0173 - any local entries are actively purged
0174 
0175