OTHER: Get values for keys matching RegExp

This commit is contained in:
Thomas Frauendorfer 2008-12-03 12:47:46 +01:00
parent 92c7c30c49
commit c6b75de31d
3 changed files with 18 additions and 1 deletions

View file

@ -48,6 +48,20 @@ XConfig::value_get (QString key)
return m_config_cache.value (key);
}
QStringList
XConfig::values_get (QRegExp key)
{
QStringList ret;
QHash < QString, QString >::ConstIterator it = m_config_cache.constBegin ();
while (it != m_config_cache.constEnd ()) {
if (key.exactMatch (it.key ())) {
ret.append (it.value ());
}
++it;
}
return ret;
}
bool
XConfig::value_set (QString key, QString val)
{