On Saturday 20 September 2008 17:51:31 Petri Damstén wrote: > On Friday 19 September 2008 16:16:16 Aaron J. Seigo wrote: > > > (or perhaps some other solution)? > > > > let me look at kconfigskeleton today... > > Would this be too big hack until kconfigskeleton supports groups? What I > looked kconfigskeleton it has to be changed quite a bit to support > kconfiggroup.
forget this... Much better to do it this way: Index: configxml.cpp =================================================================== --- configxml.cpp (revision 863068) +++ configxml.cpp (working copy) @@ -194,6 +194,7 @@ QList<QSize*> sizes; QList<quint64*> ulonglongs; QList<KUrl::List*> urllists; + QString baseGroup; QStringList groups; QHash<QString, QString> keysToNames; }; @@ -255,14 +256,23 @@ int numAttrs = attrs.count(); QString tag = localName.toLower(); if (tag == "group") { + QString group; for (int i = 0; i < numAttrs; ++i) { QString name = attrs.localName(i).toLower(); if (name == "name") { //kDebug() << "set group to" << attrs.value(i); - d->groups.append(attrs.value(i)); - m_config->setCurrentGroup(attrs.value(i)); + group = attrs.value(i); } } + if (group.isEmpty()) { + group = d->baseGroup; + } else { + d->groups.append(group); + if (!d->baseGroup.isEmpty()) { + group = d->baseGroup + '\x1d' + group; + } + } + m_config->setCurrentGroup(group); } else if (tag == "entry") { for (int i = 0; i < numAttrs; ++i) { QString name = attrs.localName(i).toLower(); @@ -522,6 +532,12 @@ : KConfigSkeleton(KSharedConfig::openConfig(config->config()->name()), parent), d(new ConfigXmlPrivate) { + KConfigGroup group = config->parent(); + d->baseGroup = config->name(); + while (group.isValid() && group.name() != "<default>") { + d->baseGroup = group.name() + '\x1d' + d->baseGroup; + group = group.parent(); + } d->parse(this, xml); } Petri
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel