On 11/22/07, Oswald Buddenhagen wrote: > On Thu, Nov 22, 2007 at 05:05:06PM -0600, Thomas Braxton wrote: > > On 11/22/07, Andreas Pakulat wrote: > > > On 22.11.07 16:36:06, Thomas Braxton wrote: > > > > + return mName.mid(mName.lastIndexOf("/")+1); > > > > + } > > > > I think the last line of name() is wrong, mName only contains a slash > > > > if the group was created with a name that contained a slash (i.e. the > > > > directories of an icon theme). So this should probably be reverted and > > > > change KConfigGroup::name() to just return mName. > > > > yes, see the attached patch, but at this point it is no fix, just an > optimization. > > > > > + groups << groupname.left(groupname.indexOf("/")); > > > > this will probably cause problems somewhere, because it is assuming > > > > that if there's a slash in the name it is a group separator. > > > > > > Which is correct as of now, because thats the separator that was chosen > > > for nested groups. The reason I changed this was that one couldn't > > > create groups by using groupList(), i.e. > > > > > KConfigGroup grp(config, "someparent"); > > > foreach(QString subgrp, grp.groupList()) > > > { > > > KConfigGroup somegrp(grp, subgrp); > > > } > > > > > > Didn't work as expected, i.e. if the file had [someparent/foo] with > > > entries I didn't get that group, but instead got the group > > > [someparent/someparent/foo]. > > > > > > Thats IMHO just plain wrong, I mean I'd expect the groupList() of > > > KConfig to do this maybe, but certainly not the groupList() on > > > KConfigGroup as that one can be nested. > > > > then appending groupname, not groupname.left(...) is probably what you want. > > > 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?