[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: [RFC] KConfig API stuff
From:       "Thomas Braxton" <kde.braxton () gmail ! com>
Date:       2007-10-21 16:58:58
Message-ID: 928c3f1b0710210958h7c2f663ej867d06f326f42a1b () mail ! gmail ! com
[Download RAW message or body]

On 10/21/07, Oswald Buddenhagen <ossi@kde.org> wrote:
>
> moin,
>
> as you probably know, puthuhn (bernhard loos) and me are fixing KConfig.
> while i'm pretty confident that nobody cares for the backend stuff we
> are doing, ;) there are also some API changes in the works.
> it's "a bit" late in the release process, so we made sure to get a
> preliminary OK from allen in advance.
> the additional effort for people not involved should be almost zero, as
> we do the complete porting - and this time you can expect quality work -
> after all, *i* am on it. ;)
> however, as this grows into unexpected dimensions, i'd like to discuss
> the changes in detail before we pursue this any further:


since you seem to think I'm a less than capable coder, I'll leave it to you.
After all you're the one with the kde.org address. But, I'll reply to this
email then I won't touch KConfig* again.

- kill kconfigbase, make kconfig inherit kconfiggroup.


It wasn't my idea, puthunh convinced me to readd it to the heirarchy.
kconfigbase was gone from my branch.

  - rationale: it is The Right Thing To Do (TM). the current asymmetry
>     of kconfig offering the group functions but no entry functions is
>     just awkward. the kconfig object itself is the <default> group (the
>     root group, or rather, the non-group) and should behave as such.


actually I would say that the kconfig object is not the default group, but
is rather the collection of *all* groups. groups also don't care about the
backend. this seems like making a collection of items a subclass of the
item. that's why kconfig offers the group functions, it is a collection of
groups. a group is a collection of entries, that's why kconfiggroup offers
the entry functions. the reason kconfiggroup also offers the group functions
is because a group can have subgroups.

  - problem: while at first it seemed like porting would be a trivial
>     search&replace in most cases, a "slight" problem turned up: kconfig
>     becomes implicitly shared, as kconfiggroup is. as a consequence, the
>     kconfiggroup constructors would take const KConfigGroup &master
>     instead of KConfigBase *master and a lot of explicit memory management
>     would need to be adapted.
>     so while as such this is definitely a feature, the porting effort is
>     just horrendous.
>   => without more helping hands, this is a no-go
>   - alternatives? maybe like this: kconfigbase dies and thus group
>     functions become unavailable via kconfig. no big loss: one can
>     already create a separate root group object - it would simply become
>     the only way. the porting effort should be *very* moderate.
>     - problems: it's uglier than the first variant
>     => no-go unless first option is unfeasible
> - renames in kconfiggroup: name to groupName, exists to groupExists,
>   rename in kconfig: name to configName
>   - rationale: clearly necessary with the changed hierarchy. does it
>     make sense without it?


if you say so. if they aren't going to have a common ancestor, the current
names are still valid, why would you ask a group what it's groupName is?
group.name() makes more sense than group.groupName(). config.name() makes
more sense than config.configName(). is there another name that they are
going to return in another function that requires the longer names?



>   => ?
> - rename kconfiggroup::clean back to to rollback.
>   - rationale: whoever renamed it had no idea of database terminology


you're right I don't know database terminology, but I know enough to know
that to rollback a db means to return to some previous state, which this
doesn't do. That's why I thought the name should be changed, to reflect what
it actually does and not pretend it does more.

  => go
> - remove kconfig::setGroup & kconfig::group
>   - rationale: the api sucks and is deprecated about forever.
>     additionally, in the current trunk it is outright defunct.
>   - problem: still some users left to port, but within reason
>   => still on go


agree

- remove kconfiggroup::changeGroup
>   - rationale: the api sucks - it is about the same as kconfig::setGroup
>   - problem: quite some users
>   => prolly no-go, will stay with deprecation


agree

- remove kconfiggroup::group
>   - rationale: it is just a weird way to call the constructor:


Actually I was thinking of going the other way, to make read-only groups
work correctly. make all the constructors protected except KConfigGroup() &
KConfigGroup(const KConfigGroup&).

    cg = KConfig(...).group("blah") => cg = KConfigGroup( KConfig(...),
> "blah" )
>     KConfigGroup cg( KConfig(...).group("blah") ) => KConfigGroup cg(
> KConfig(...), "blah" )
>   - problem: quite some users
>   => prolly no-go, will go with deprecation
> - remove kconfiggroup::sync

  - rationale: the api suggests a granularity that is simply not given.
>     cg.config().sync() is the proper call.


kinda agree

  - problems:
>     - quite some users. manageable, though.
>     - more verbose code. do we want it?
>   => ?
> - remove kconfiggroup::getConfigState


Again, another addition from puthuhn.

  - rationale: the api suggests a granularity that is simply not given.
>     cg.config().getConfigState() is the proper call.
>   => go
> - rename kconfig::getConfigState to accessMode
>   - rationale: states: noAccess, readOnly, readWrite ... no comment


agree

  => go
> - rename kconfiggroup::entryIsImmutable to isEntryImmutable
>   - rationale: better, right?


works either way.

  => go
> - move kconfiggroup::setReadDefaults to kconfig
>   - rationale: all users (mostly kconfigskeleton derivatives) deal with
> the
>     entire file at once anyway

  - problem: it's ugly and cries "i'm not reentrant"


another problem, how do you ensure that it is set on every group that comes
from a config object that is supposed to be reading defaults only?

  => no-go?
> - remove kconfig::setForceGlobal
>   - rationale: only user is kfile/kfilewidget.cpp. the alternative api
>     is passing the KConfigGroup::Global flag to writeEntry calls.


actually it's also set whenever "kdeglobals" is opened explicitely, so that
whoever is using it doesn't have to pass KConfigGroup::Global to every
writeEntry call.

  - alternatively, one might view it just like setReadDefaults and move
>     it to kconfiggroup instead.
>   => go?
> - remove kconfiggroup::NLS
>   - rationale: it is an alias for Localized. the internal KEntry uses
>     the Localized terminology, too, so for the sake of consistency ...
>   => go


either way.

- remove kconfig OnlyLocal and NoGlobals
>   - rationale: they are aliases for SimpleConfig resp. CascadeConfig.
>     it's more to learn and the negative meanings are potentially
>     confusing.


That's why I changed the names.

  => go
> - remove the separator argument from {read,write}Entry for lists
>   - rationale: the separator is a backend internal detail. with some
>     backends, it might be plain unchangeable.


agree

  - problems: none
>   - non-problems:
>     - there are some abuses of the separator argument and some plain
>       pointless uses. easily fixable.
>     - it was suggested that this would imply changing the kde-wide
>       separator back to the semicolon, as .desktop files use the
>       semicolon and kdesktopfile is in fact a kconfig, so we'd have no
>       way to get it right otherwise.
>       in fact, we might provide an api (possibly accessible by
>       kdesktopfile only) to put the entire file into .desktop mode -
>       that makes most sense anyway.
>       however, if somebody wants to go with semicolons kde-wide (hi
>       maelcum ;), the same as in my mail "KConfig list entries vs. kde3
>       vs. desktop entry spec" applies.
>   => clear go
> - remove kconfiggroup::entryMap
>   - rationale: the api sucks. it wants to return all values as strings,
>     which might be simply impossible without quite some additional magic
>     with some backends.


The only *hard* problem that I know of right now with returning strings is
when a stringlist has an entry that has backslash as it's last char confuses
KConfigGroup into thinking the separator is escaped when it shouldn't
be. I've tried to fix this multiple times, but you thought each was
sub-optimal.

I was thinking about changing this to return QMap<QString,QVariant>, when I
changed KEntry to use QVariant instead of QByteArray, but since I'm out of
this...

  - problems:
>     - the replacement api is keyList() plus readEntry(). however, when
>       one uses keyList() in the first place, it might mean that he has
>       no idea what type to expect from the entry. anyway,
>       returning/printing errors on individual readEntry() calls is
>       probably better than returning a partial map.
>     - the replacement is slower. hardly a problem, realistically
>       speaking.
>     - there are some users. probably sub-critical.
>   => go, maybe only deprecate instead.
>
> the code can be found under branches/work/kconfig_new_take2/ .
> note that not all changes are implemented yet and nothing beyond kdelibs
> is guaranteed to compile.
>
> --
> Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
>
> --
> Chaos, panic, and disorder - my work here is done.
>

[Attachment #3 (text/html)]

<br><br><div><span class="gmail_quote">On 10/21/07, <b \
class="gmail_sendername">Oswald Buddenhagen</b> &lt;<a \
href="mailto:ossi@kde.org">ossi@kde.org</a>&gt; wrote:</span><blockquote \
class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc \
solid;padding-left:1ex"> moin,<br><br>as you probably know, puthuhn (bernhard loos) \
and me are fixing KConfig.<br>while i&#39;m pretty confident that nobody cares for \
the backend stuff we<br>are doing, ;) there are also some API changes in the works. \
<br>it&#39;s &quot;a bit&quot; late in the release process, so we made sure to get \
a<br>preliminary OK from allen in advance.<br>the additional effort for people not \
involved should be almost zero, as<br>we do the complete porting - and this time you \
can expect quality work - <br>after all, *i* am on it. ;)<br>however, as this grows \
into unexpected dimensions, i&#39;d like to discuss<br>the changes in detail before \
we pursue this any further:</blockquote><div><br class="webkit-block-placeholder"> \
</div><div>since you seem to think I&#39;m a less than capable coder, I&#39;ll leave \
it to you. After all you&#39;re the one with the <a href="http://kde.org">kde.org</a> \
address. But, I&#39;ll reply to this email then I won&#39;t touch KConfig* again. \
</div><br><blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">- kill \
kconfigbase, make kconfig inherit kconfiggroup.</blockquote><div><br \
class="webkit-block-placeholder"> </div><div>It wasn&#39;t my idea, puthunh convinced \
me to readd it to the heirarchy. kconfigbase was gone from my \
branch.&nbsp;</div><br><blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"> \
&nbsp;&nbsp;- rationale: it is The Right Thing To Do (TM). the current \
asymmetry<br>&nbsp;&nbsp;&nbsp;&nbsp;of kconfig offering the group functions but no \
entry functions is<br>&nbsp;&nbsp;&nbsp;&nbsp;just awkward. the kconfig object itself \
is the &lt;default&gt; group (the <br>&nbsp;&nbsp;&nbsp;&nbsp;root group, or rather, \
the non-group) and should behave as such.</blockquote><div><br \
class="webkit-block-placeholder"></div><div>actually I would say that the kconfig \
object is not the default group, but is rather the collection of *all* groups. groups \
also don&#39;t care about the backend. this seems like making a collection of items a \
subclass of the item. that&#39;s why kconfig offers the group functions, it is a \
collection of groups. a group is a collection of entries, that&#39;s why kconfiggroup \
offers the entry functions. the reason kconfiggroup also offers the group functions \
is because a group can have subgroups. </div><br><blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc \
solid;padding-left:1ex">&nbsp;&nbsp;- problem: while at first it seemed like porting \
would be a trivial<br>&nbsp;&nbsp;&nbsp;&nbsp;search&amp;replace in most cases, a \
&quot;slight&quot; problem turned up: kconfig <br>&nbsp;&nbsp;&nbsp;&nbsp;becomes \
implicitly shared, as kconfiggroup is. as a consequence, \
the<br>&nbsp;&nbsp;&nbsp;&nbsp;kconfiggroup constructors would take const \
KConfigGroup &amp;master<br>&nbsp;&nbsp;&nbsp;&nbsp;instead of KConfigBase *master \
and a lot of explicit memory management <br>&nbsp;&nbsp;&nbsp;&nbsp;would need to be \
adapted.<br>&nbsp;&nbsp;&nbsp;&nbsp;so while as such this is definitely a feature, \
the porting effort is<br>&nbsp;&nbsp;&nbsp;&nbsp;just \
horrendous.<br>&nbsp;&nbsp;=&gt; without more helping hands, this is a \
no-go<br>&nbsp;&nbsp;- alternatives? maybe like this: kconfigbase dies and thus group \
<br>&nbsp;&nbsp;&nbsp;&nbsp;functions become unavailable via kconfig. no big loss: \
one can<br>&nbsp;&nbsp;&nbsp;&nbsp;already create a separate root group object - it \
would simply become<br>&nbsp;&nbsp;&nbsp;&nbsp;the only way. the porting effort \
should be *very* moderate.<br>&nbsp;&nbsp;&nbsp;&nbsp;- problems: it&#39;s uglier \
than the first variant <br>&nbsp;&nbsp;&nbsp;&nbsp;=&gt; no-go unless first option is \
unfeasible<br>- renames in kconfiggroup: name to groupName, exists to \
groupExists,<br>&nbsp;&nbsp;rename in kconfig: name to configName<br>&nbsp;&nbsp;- \
rationale: clearly necessary with the changed hierarchy. does it \
<br>&nbsp;&nbsp;&nbsp;&nbsp;make sense without it?</blockquote><div><br \
class="webkit-block-placeholder"></div><div>  if you say so. if they aren&#39;t going \
to have a common ancestor, the current names are still valid, why would you ask a \
group what it&#39;s groupName is? group.name() makes more sense than \
group.groupName(). config.name () makes more sense than config.configName(). is there \
another name that they are going to return in another function that requires the \
longer names?</div><div><br>&nbsp;</div><blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"> \
&nbsp;&nbsp;=&gt; ?<br>- rename kconfiggroup::clean back to to \
rollback.<br>&nbsp;&nbsp;- rationale: whoever renamed it had no idea of database \
terminology</blockquote><div><br \
class="webkit-block-placeholder"></div><div>you&#39;re right I don&#39;t know \
database terminology, but I know enough to know that to rollback a db means to return \
to some previous state, which this doesn&#39;t do. That&#39;s why I thought the name \
should be changed, to reflect what it actually does and not pretend it does more. \
</div><br><blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc \
solid;padding-left:1ex">&nbsp;&nbsp;=&gt; go<br>- remove kconfig::setGroup &amp; \
kconfig::group<br>&nbsp;&nbsp;- rationale: the api sucks and is deprecated about \
forever. <br>&nbsp;&nbsp;&nbsp;&nbsp;additionally, in the current trunk it is \
outright defunct.<br>&nbsp;&nbsp;- problem: still some users left to port, but within \
reason<br>&nbsp;&nbsp;=&gt; still on go</blockquote><div><br \
class="webkit-block-placeholder"></div><div>agree&nbsp; </div><br><blockquote \
class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc \
solid;padding-left:1ex">- remove kconfiggroup::changeGroup<br>&nbsp;&nbsp;- \
rationale: the api sucks - it is about the same as kconfig::setGroup \
<br>&nbsp;&nbsp;- problem: quite some users<br>&nbsp;&nbsp;=&gt; prolly no-go, will \
stay with deprecation</blockquote><div><br \
class="webkit-block-placeholder"></div><div>agree</div><br><blockquote \
class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc \
                solid;padding-left:1ex">
- remove kconfiggroup::group<br>&nbsp;&nbsp;- rationale: it is just a weird way to \
call the constructor:</blockquote><div><br \
class="webkit-block-placeholder"></div><div>Actually I was thinking of going the \
other way, to make read-only groups work correctly. make all the constructors \
protected except KConfigGroup() &amp; KConfigGroup(const KConfigGroup&amp;).&nbsp; \
</div><br><blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc \
solid;padding-left:1ex">&nbsp;&nbsp;&nbsp;&nbsp;cg = \
KConfig(...).group(&quot;blah&quot;) =&gt; cg = KConfigGroup( KConfig(...), \
&quot;blah&quot; ) <br>&nbsp;&nbsp;&nbsp;&nbsp;KConfigGroup cg( \
KConfig(...).group(&quot;blah&quot;) ) =&gt; KConfigGroup cg( KConfig(...), \
&quot;blah&quot; )<br>&nbsp;&nbsp;- problem: quite some users<br>&nbsp;&nbsp;=&gt; \
prolly no-go, will go with deprecation<br>- remove kconfiggroup::sync \
</blockquote><blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc \
solid;padding-left:1ex">&nbsp;&nbsp;- rationale: the api suggests a granularity that \
is simply not given.<br>&nbsp;&nbsp;&nbsp;&nbsp;cg.config().sync() is the proper \
call. </blockquote><div><br class="webkit-block-placeholder"></div><div>kinda \
agree</div><br><blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc \
solid;padding-left:1ex">&nbsp;&nbsp;- problems:<br>&nbsp;&nbsp;&nbsp;&nbsp;- quite \
some users. manageable, though. <br>&nbsp;&nbsp;&nbsp;&nbsp;- more verbose code. do \
we want it?<br>&nbsp;&nbsp;=&gt; ?<br>- remove \
kconfiggroup::getConfigState</blockquote><div><br \
class="webkit-block-placeholder"></div><div>Again, another addition from \
puthuhn.</div><br><blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"> \
&nbsp;&nbsp;- rationale: the api suggests a granularity that is simply not \
given.<br>&nbsp;&nbsp;&nbsp;&nbsp;cg.config().getConfigState() is the proper \
call.<br>&nbsp;&nbsp;=&gt; go<br>- rename kconfig::getConfigState to \
accessMode<br>&nbsp;&nbsp;- rationale: states: noAccess, readOnly, readWrite ... no \
comment </blockquote><div><br \
class="webkit-block-placeholder"></div><div>agree</div><br><blockquote \
class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc \
solid;padding-left:1ex">&nbsp;&nbsp;=&gt; go<br>- rename \
kconfiggroup::entryIsImmutable to isEntryImmutable <br>&nbsp;&nbsp;- rationale: \
better, right?</blockquote><div><br class="webkit-block-placeholder"></div><div>works \
either way.</div><br><blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"> \
&nbsp;&nbsp;=&gt; go<br>- move kconfiggroup::setReadDefaults to \
kconfig<br>&nbsp;&nbsp;- rationale: all users (mostly kconfigskeleton derivatives) \
deal with the<br>&nbsp;&nbsp;&nbsp;&nbsp;entire file at once \
anyway</blockquote><blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"> \
&nbsp;&nbsp;- problem: it&#39;s ugly and cries &quot;i&#39;m not \
reentrant&quot;</blockquote><div><br \
class="webkit-block-placeholder"></div><div>another problem, how do you ensure that \
it is set on every group that comes from a config object that is supposed to be \
reading defaults only?&nbsp; </div><br><blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc \
solid;padding-left:1ex">&nbsp;&nbsp;=&gt; no-go?<br>- remove \
kconfig::setForceGlobal<br>&nbsp;&nbsp;- rationale: only user is \
kfile/kfilewidget.cpp. the alternative api <br>&nbsp;&nbsp;&nbsp;&nbsp;is passing the \
KConfigGroup::Global flag to writeEntry calls.</blockquote><div><br \
class="webkit-block-placeholder"></div><div>actually it&#39;s also set whenever \
&quot;kdeglobals&quot; is opened explicitely, so that whoever is using it doesn&#39;t \
have to pass KConfigGroup::Global to every writeEntry call. </div><br><blockquote \
class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc \
solid;padding-left:1ex">&nbsp;&nbsp;- alternatively, one might view it just like \
setReadDefaults and move<br>&nbsp;&nbsp;&nbsp;&nbsp;it to kconfiggroup instead. \
<br>&nbsp;&nbsp;=&gt; go?<br>- remove kconfiggroup::NLS<br>&nbsp;&nbsp;- rationale: \
it is an alias for Localized. the internal KEntry uses<br>&nbsp;&nbsp;&nbsp;&nbsp;the \
Localized terminology, too, so for the sake of consistency ...<br>&nbsp;&nbsp;=&gt; \
go</blockquote><div> <br class="webkit-block-placeholder"></div><div>either \
way.&nbsp;</div><br><blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">- \
remove kconfig OnlyLocal and NoGlobals <br>&nbsp;&nbsp;- rationale: they are aliases \
for SimpleConfig resp. CascadeConfig.<br>&nbsp;&nbsp;&nbsp;&nbsp;it&#39;s more to \
learn and the negative meanings are \
potentially<br>&nbsp;&nbsp;&nbsp;&nbsp;confusing.</blockquote><div><br \
class="webkit-block-placeholder"></div> <div>That&#39;s why I changed the \
names.&nbsp;</div><br><blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc \
solid;padding-left:1ex">&nbsp;&nbsp;=&gt; go<br>- remove the separator argument from \
{read,write}Entry for lists <br>&nbsp;&nbsp;- rationale: the separator is a backend \
internal detail. with some<br>&nbsp;&nbsp;&nbsp;&nbsp;backends, it might be plain \
unchangeable.</blockquote><div><br \
class="webkit-block-placeholder"></div><div>agree&nbsp;</div><br><blockquote \
class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc \
solid;padding-left:1ex"> &nbsp;&nbsp;- problems: none<br>&nbsp;&nbsp;- \
non-problems:<br>&nbsp;&nbsp;&nbsp;&nbsp;- there are some abuses of the separator \
argument and some plain<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pointless uses. easily \
fixable.<br>&nbsp;&nbsp;&nbsp;&nbsp;- it was suggested that this would imply changing \
the kde-wide <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;separator back to the semicolon, \
as .desktop files use the<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;semicolon and \
kdesktopfile is in fact a kconfig, so we&#39;d have \
no<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;way to get it right \
otherwise.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in fact, we might provide an api \
(possibly accessible by <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kdesktopfile only) to \
put the entire file into .desktop mode -<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;that \
makes most sense anyway.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;however, if somebody \
wants to go with semicolons kde-wide \
(hi<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;maelcum ;), the same as in my mail \
&quot;KConfig list entries vs. kde3 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vs. \
desktop entry spec&quot; applies.<br>&nbsp;&nbsp;=&gt; clear go<br>- remove \
kconfiggroup::entryMap<br>&nbsp;&nbsp;- rationale: the api sucks. it wants to return \
all values as strings,<br>&nbsp;&nbsp;&nbsp;&nbsp;which might be simply impossible \
without quite some additional magic <br>&nbsp;&nbsp;&nbsp;&nbsp;with some \
backends.</blockquote><div><br class="webkit-block-placeholder"></div><div>The only \
*hard* problem that I know of right now with returning strings is when a stringlist \
has an entry that has backslash as it&#39;s last char confuses KConfigGroup into \
thinking the separator is escaped when it shouldn&#39;t be.&nbsp;I&#39;ve tried to \
fix this multiple times, but you thought each was sub-optimal. </div><div><br \
class="webkit-block-placeholder"></div><div>I&nbsp;was thinking about changing this \
to return QMap&lt;QString,QVariant&gt;, when I changed KEntry to use QVariant instead \
of QByteArray, but since I&#39;m out of this... </div><br><blockquote \
class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc \
solid;padding-left:1ex">&nbsp;&nbsp;- problems:<br>&nbsp;&nbsp;&nbsp;&nbsp;- the \
replacement api is keyList() plus readEntry(). however, \
when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;one uses keyList() in the first place, it \
might mean that he has <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no idea what type to \
expect from the entry. \
anyway,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;returning/printing errors on \
individual readEntry() calls is<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;probably \
better than returning a partial map.<br>&nbsp;&nbsp;&nbsp;&nbsp;- the replacement is \
slower. hardly a problem, realistically \
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;speaking.<br>&nbsp;&nbsp;&nbsp;&nbsp;- there \
are some users. probably sub-critical.<br>&nbsp;&nbsp;=&gt; go, maybe only deprecate \
instead.<br><br>the code can be found under branches/work/kconfig_new_take2/ \
.<br>note that not all changes are implemented yet and nothing beyond kdelibs <br>is \
guaranteed to compile.<br><br>--<br>Hi! I&#39;m a .signature virus! Copy me into your \
~/.signature, please!<br><br>--<br>Chaos, panic, and disorder - my work here is \
done.<br></blockquote></div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic