-rw-r--r-- | microkde/kconfig.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/microkde/kconfig.cpp b/microkde/kconfig.cpp index 940196e..12063ca 100644 --- a/microkde/kconfig.cpp +++ b/microkde/kconfig.cpp | |||
@@ -1,5 +1,7 @@ | |||
1 | #include <qfile.h> | 1 | #include <qfile.h> |
2 | #include <qtextstream.h> | 2 | #include <q3textstream.h> |
3 | #include <qwidget.h> | 3 | #include <qwidget.h> |
4 | //Added by qt3to4: | ||
5 | #include <Q3ValueList> | ||
4 | 6 | ||
5 | #include "kdebug.h" | 7 | #include "kdebug.h" |
@@ -54,9 +56,9 @@ QString KConfig::group() const { | |||
54 | 56 | ||
55 | //US added method | 57 | //US added method |
56 | QValueList<int> KConfig::readIntListEntry( const QString & key) | 58 | Q3ValueList<int> KConfig::readIntListEntry( const QString & key) |
57 | { | 59 | { |
58 | // qDebug("KConfig::readIntListEntry key=%s:", key.latin1()); | 60 | // qDebug("KConfig::readIntListEntry key=%s:", key.latin1()); |
59 | 61 | ||
60 | QValueList<int> result; | 62 | Q3ValueList<int> result; |
61 | 63 | ||
62 | QMap<QString,QString>::ConstIterator mit = mStringMap.find( mGroup + key ); | 64 | QMap<QString,QString>::ConstIterator mit = mStringMap.find( mGroup + key ); |
@@ -112,5 +114,5 @@ QString KConfig::readEntry( const QString &key, const QString &def ) | |||
112 | QSize KConfig::readSizeEntry( const QString &key, QSize* def ) | 114 | QSize KConfig::readSizeEntry( const QString &key, QSize* def ) |
113 | { | 115 | { |
114 | QValueList<int> intlist = readIntListEntry(key); | 116 | Q3ValueList<int> intlist = readIntListEntry(key); |
115 | 117 | ||
116 | if (intlist.count() < 2) | 118 | if (intlist.count() < 2) |
@@ -195,9 +197,9 @@ QDateTime KConfig::readDateTimeEntry( const QString &key, const QDateTime *def ) | |||
195 | 197 | ||
196 | //US added method | 198 | //US added method |
197 | void KConfig::writeEntry( const QString &key, const QValueList<int> &value) | 199 | void KConfig::writeEntry( const QString &key, const Q3ValueList<int> &value) |
198 | { | 200 | { |
199 | QStringList valuesAsStrings; | 201 | QStringList valuesAsStrings; |
200 | 202 | ||
201 | QValueList<int>::ConstIterator it; | 203 | Q3ValueList<int>::ConstIterator it; |
202 | 204 | ||
203 | for( it = value.begin(); it != value.end(); ++it ) | 205 | for( it = value.begin(); it != value.end(); ++it ) |
@@ -247,5 +249,5 @@ void KConfig::writeEntry( const QString & e, const QColor & c ) | |||
247 | void KConfig::writeEntry( const QString & e, const QSize & s ) | 249 | void KConfig::writeEntry( const QString & e, const QSize & s ) |
248 | { | 250 | { |
249 | QValueList<int> intlist; | 251 | Q3ValueList<int> intlist; |
250 | intlist << s.width() << s.height(); | 252 | intlist << s.width() << s.height(); |
251 | writeEntry( e, intlist ); | 253 | writeEntry( e, intlist ); |
@@ -272,5 +274,5 @@ void KConfig::load() | |||
272 | 274 | ||
273 | QFile f( mFileName ); | 275 | QFile f( mFileName ); |
274 | if ( !f.open( IO_ReadOnly ) ) { | 276 | if ( !f.open( QIODevice::ReadOnly ) ) { |
275 | //qDebug("KConfig: could not open file %s ",mFileName.latin1() ); | 277 | //qDebug("KConfig: could not open file %s ",mFileName.latin1() ); |
276 | return; | 278 | return; |
@@ -280,10 +282,10 @@ void KConfig::load() | |||
280 | mStringMap.clear(); | 282 | mStringMap.clear(); |
281 | 283 | ||
282 | QTextStream t( &f ); | 284 | Q3TextStream t( &f ); |
283 | t.setEncoding( QTextStream::Latin1 ); | 285 | t.setEncoding( Q3TextStream::Latin1 ); |
284 | QString line = t.readLine(); | 286 | QString line = t.readLine(); |
285 | 287 | ||
286 | while ( !line.isNull() ) { | 288 | while ( !line.isNull() ) { |
287 | QStringList tokens = QStringList::split( ",", line ); | 289 | QStringList tokens = line.split(','); |
288 | if ( tokens[0] == "bool" ) { | 290 | if ( tokens[0] == "bool" ) { |
289 | bool value = false; | 291 | bool value = false; |
@@ -324,5 +326,5 @@ void KConfig::sync() | |||
324 | 326 | ||
325 | QFile f( mFileName ); | 327 | QFile f( mFileName ); |
326 | if ( !f.open( IO_WriteOnly ) ) { | 328 | if ( !f.open( QIODevice::WriteOnly ) ) { |
327 | 329 | ||
328 | qDebug("KConfig::sync() Can't open file %s ",mFileName.latin1() ); | 330 | qDebug("KConfig::sync() Can't open file %s ",mFileName.latin1() ); |
@@ -331,6 +333,6 @@ void KConfig::sync() | |||
331 | } | 333 | } |
332 | 334 | ||
333 | QTextStream t( &f ); | 335 | Q3TextStream t( &f ); |
334 | t.setEncoding( QTextStream::Latin1 ); | 336 | t.setEncoding( Q3TextStream::Latin1 ); |
335 | QMap<QString,bool>::ConstIterator itBool; | 337 | QMap<QString,bool>::ConstIterator itBool; |
336 | for( itBool = mBoolMap.begin(); itBool != mBoolMap.end(); ++itBool ) { | 338 | for( itBool = mBoolMap.begin(); itBool != mBoolMap.end(); ++itBool ) { |