-rw-r--r-- | microkde/kconfig.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/microkde/kconfig.cpp b/microkde/kconfig.cpp index 4cbec94..ba41f6c 100644 --- a/microkde/kconfig.cpp +++ b/microkde/kconfig.cpp @@ -111,2 +111,21 @@ QString KConfig::readEntry( const QString &key, const QString &def ) +QSize KConfig::readSizeEntry( const QString &key, QSize* def ) +{ + QValueList<int> intlist = readIntListEntry(key); + + if (intlist.count() < 2) + { + if (def) + return *def; + else + return QSize(); + } + + QSize ret; + ret.setWidth(intlist[0]); + ret.setHeight(intlist[1]); + + return ret; +} + QStringList KConfig::readListEntry( const QString &key ) @@ -224,2 +243,9 @@ void KConfig::writeEntry( const QString & e, const QColor & c ) +void KConfig::writeEntry( const QString & e, const QSize & s ) +{ + QValueList<int> intlist; + intlist << s.width() << s.height(); + writeEntry( e, intlist ); +} + void KConfig::writeEntry( const QString & e , const QFont & f ) |