-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 | |||
@@ -109,6 +109,25 @@ QString KConfig::readEntry( const QString &key, const QString &def ) | |||
109 | return *it; | 109 | return *it; |
110 | } | 110 | } |
111 | 111 | ||
112 | QSize KConfig::readSizeEntry( const QString &key, QSize* def ) | ||
113 | { | ||
114 | QValueList<int> intlist = readIntListEntry(key); | ||
115 | |||
116 | if (intlist.count() < 2) | ||
117 | { | ||
118 | if (def) | ||
119 | return *def; | ||
120 | else | ||
121 | return QSize(); | ||
122 | } | ||
123 | |||
124 | QSize ret; | ||
125 | ret.setWidth(intlist[0]); | ||
126 | ret.setHeight(intlist[1]); | ||
127 | |||
128 | return ret; | ||
129 | } | ||
130 | |||
112 | QStringList KConfig::readListEntry( const QString &key ) | 131 | QStringList KConfig::readListEntry( const QString &key ) |
113 | { | 132 | { |
114 | QMap<QString,QString>::ConstIterator it = mStringMap.find( mGroup + key ); | 133 | QMap<QString,QString>::ConstIterator it = mStringMap.find( mGroup + key ); |
@@ -222,6 +241,13 @@ void KConfig::writeEntry( const QString & e, const QColor & c ) | |||
222 | writeEntry( e, l ); | 241 | writeEntry( e, l ); |
223 | } | 242 | } |
224 | 243 | ||
244 | void KConfig::writeEntry( const QString & e, const QSize & s ) | ||
245 | { | ||
246 | QValueList<int> intlist; | ||
247 | intlist << s.width() << s.height(); | ||
248 | writeEntry( e, intlist ); | ||
249 | } | ||
250 | |||
225 | void KConfig::writeEntry( const QString & e , const QFont & f ) | 251 | void KConfig::writeEntry( const QString & e , const QFont & f ) |
226 | { | 252 | { |
227 | QStringList font; | 253 | QStringList font; |