make it easy to get at items and values by name

svn path=/trunk/KDE/kdelibs/; revision=906335
This commit is contained in:
Aaron J. Seigo 2009-01-05 23:27:29 +00:00
parent 102cd88d29
commit cf32d4770d
2 changed files with 26 additions and 0 deletions

View File

@ -387,6 +387,22 @@ KConfigSkeletonItem *ConfigLoader::findItem(const QString &group, const QString
return KConfigSkeleton::findItem(d->keysToNames[group + key]);
}
KConfigSkeletonItem *ConfigLoader::findItemByName(const QString &name)
{
return KConfigSkeleton::findItem(name);
}
QVariant ConfigLoader::property(const QString &name)
{
KConfigSkeletonItem *item = KConfigSkeleton::findItem(name);
if (item) {
return item->property();
}
return QVariant();
}
bool ConfigLoader::hasGroup(const QString &group) const
{
return d->groups.contains(group);

View File

@ -115,6 +115,16 @@ public:
*/
KConfigSkeletonItem *findItem(const QString &group, const QString &key);
/**
* Finds an item by its name
*/
KConfigSkeletonItem *findItemByName(const QString &name);
/**
* Returns the property (variantized value) of the named item
*/
QVariant property(const QString &name);
/**
* Check to see if a group exists
*