KConfigGroup (Re: KDE/kdelibs/khtml)
Stephan Kulow
coolo at kde.org
Mon Feb 12 10:05:12 GMT 2007
Am Montag, 12. Februar 2007 10:18 schrieb Simon Hausmann:
>
> But it has the downside that one has to learn about two KConfigGroup and
> KGlobal ;(. If the first thing people see in the documentation when they
> want to learn about KConfigGroup is that they have to use it together with
> another class called KGlobal I bet they'd find it confusing.
So far I only checked kdelibs, but there KGlobal::config() is far from
popular. So I guess a KGlobal::config()->group("General") is just fine and it
has the huge advantage that you can replace
QString oldgroup = KGlobal::config()->group();
KGlobal::config()->setGroup("General");
int time = KGlobal::config()->readEntry("Key", 0);
KGlobal::config()->setGroup(oldgroup);
with
int time = KGlobal::config()->group("General").readEntry("Key", 0);
Greetings, Stephan
More information about the kde-core-devel
mailing list