From kde-core-devel Fri Nov 23 08:28:41 2007 From: Oswald Buddenhagen Date: Fri, 23 Nov 2007 08:28:41 +0000 To: kde-core-devel Subject: Re: even more on kconfig escapes (Re: KDE/kdelibs/kdeui/icons) Message-Id: <20071123082841.GA7911 () ugly ! local> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=119580653010344 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--3V7upXqbjpZ4EhLz" --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Nov 22, 2007 at 09:28:39PM -0600, Thomas Braxton wrote: > On 11/22/07, Oswald Buddenhagen wrote: > > no, that code is correct. you want only direct children of a group. > > e.g., if the hierarchy someparent/foo/blubb exists, you don't want > > foo/blubb, only foo. that's correct even if foo itself does not > > contain any entries. > > > Ok, so with this change to name() and changing the separator does this > work now? > is there a reason to doubt it? well, actually, there is, but that's something you did already. see patch. -- Hi! I'm a .signature virus! Copy me into your ~/.signature, please! -- Chaos, panic, and disorder - my work here is done. --3V7upXqbjpZ4EhLz Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="kconfig-prefix.diff" commit 9b8af52e2a5a5e229b4270bf7a9b75631d41a6c4 Author: Oswald Buddenhagen Date: Fri Nov 23 01:18:28 2007 +0100 don't claim /bar to be a child of /foo when looking at /foobar. diff --git a/config/kconfig.cpp b/config/kconfig.cpp index 3b87d42..8acae13 100644 --- a/config/kconfig.cpp +++ b/config/kconfig.cpp @@ -167,12 +167,13 @@ QStringList KConfig::groupList() const QStringList KConfigPrivate::groupList(const QByteArray& group) const { + QByteArray theGroup = group + '\x1d'; QSet groups; foreach (const KEntryKey& key, entryMap.keys()) - if (key.mKey.isNull() && key.mGroup.startsWith(group) && key.mGroup != group) + if (key.mKey.isNull() && key.mGroup.startsWith(theGroup)) { - QString groupname = QString::fromUtf8(key.mGroup.mid(group.length()+1)); + QString groupname = QString::fromUtf8(key.mGroup.mid(theGroup.length())); groups << groupname.left(groupname.indexOf('\x1d')); } --3V7upXqbjpZ4EhLz--