diff -r 6a0342b3c519 -r 70c41284cb48 settings.cpp --- a/settings.cpp Tue Jun 13 08:49:12 2006 +0000 +++ b/settings.cpp Thu Aug 31 11:55:33 2006 +0000 @@ -61,6 +61,7 @@ qWarning ("SimpleSettings::writeSettings() Couldn't write "+path); } +/* QString SimpleSettings::readEntry (const QString &key) { QStringList::Iterator itk=keylist.begin(); @@ -77,6 +78,46 @@ qWarning ("SimpleSettings::readEntry() Couldn't find key "+key); return ""; } +*/ + +QString SimpleSettings::readEntry (const QString &key, const QString &def) +{ + QStringList::Iterator itk=keylist.begin(); + QStringList::Iterator itv=valuelist.begin(); + + // First search for value in settings saved in map + while (itk !=keylist.end() ) + { + if (*itk == key) + return *itv; + itk++; + itv++; + } + return def; +} + +int SimpleSettings::readNumEntry (const QString &key, int def) +{ + QStringList::Iterator itk=keylist.begin(); + QStringList::Iterator itv=valuelist.begin(); + + // First search for value in settings saved in map + while (itk !=keylist.end() ) + { + if (*itk == key) + { + bool ok; + int i=(*itv).toInt(&ok,10); + if (ok) + return i; + else + return def; + } + itk++; + itv++; + } + return def; +} void SimpleSettings::setEntry (const QString &key, const QString &value) {