From a08aff328d4393031d5ba7d622c2b05705a89d73 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Wed, 04 Jul 2007 11:23:42 +0000 Subject: initial public commit of qt4 port --- (limited to 'microkde/kconfig.cpp') diff --git a/microkde/kconfig.cpp b/microkde/kconfig.cpp index 940196e..12063ca 100644 --- a/microkde/kconfig.cpp +++ b/microkde/kconfig.cpp @@ -1,6 +1,8 @@ #include -#include +#include #include +//Added by qt3to4: +#include #include "kdebug.h" @@ -53,11 +55,11 @@ QString KConfig::group() const { } //US added method -QValueList KConfig::readIntListEntry( const QString & key) +Q3ValueList KConfig::readIntListEntry( const QString & key) { // qDebug("KConfig::readIntListEntry key=%s:", key.latin1()); - QValueList result; + Q3ValueList result; QMap::ConstIterator mit = mStringMap.find( mGroup + key ); @@ -111,7 +113,7 @@ QString KConfig::readEntry( const QString &key, const QString &def ) QSize KConfig::readSizeEntry( const QString &key, QSize* def ) { - QValueList intlist = readIntListEntry(key); + Q3ValueList intlist = readIntListEntry(key); if (intlist.count() < 2) { @@ -194,11 +196,11 @@ QDateTime KConfig::readDateTimeEntry( const QString &key, const QDateTime *def ) } //US added method -void KConfig::writeEntry( const QString &key, const QValueList &value) +void KConfig::writeEntry( const QString &key, const Q3ValueList &value) { QStringList valuesAsStrings; - QValueList::ConstIterator it; + Q3ValueList::ConstIterator it; for( it = value.begin(); it != value.end(); ++it ) { @@ -246,7 +248,7 @@ void KConfig::writeEntry( const QString & e, const QColor & c ) void KConfig::writeEntry( const QString & e, const QSize & s ) { - QValueList intlist; + Q3ValueList intlist; intlist << s.width() << s.height(); writeEntry( e, intlist ); } @@ -271,7 +273,7 @@ void KConfig::load() QFile f( mFileName ); - if ( !f.open( IO_ReadOnly ) ) { + if ( !f.open( QIODevice::ReadOnly ) ) { //qDebug("KConfig: could not open file %s ",mFileName.latin1() ); return; } @@ -279,12 +281,12 @@ void KConfig::load() mBoolMap.clear(); mStringMap.clear(); - QTextStream t( &f ); - t.setEncoding( QTextStream::Latin1 ); + Q3TextStream t( &f ); + t.setEncoding( Q3TextStream::Latin1 ); QString line = t.readLine(); while ( !line.isNull() ) { - QStringList tokens = QStringList::split( ",", line ); + QStringList tokens = line.split(','); if ( tokens[0] == "bool" ) { bool value = false; if ( tokens[2] == "1" ) value = true; @@ -323,15 +325,15 @@ void KConfig::sync() KStandardDirs::makeDir(dir); QFile f( mFileName ); - if ( !f.open( IO_WriteOnly ) ) { + if ( !f.open( QIODevice::WriteOnly ) ) { qDebug("KConfig::sync() Can't open file %s ",mFileName.latin1() ); return; } - QTextStream t( &f ); - t.setEncoding( QTextStream::Latin1 ); + Q3TextStream t( &f ); + t.setEncoding( Q3TextStream::Latin1 ); QMap::ConstIterator itBool; for( itBool = mBoolMap.begin(); itBool != mBoolMap.end(); ++itBool ) { t << "bool," << itBool.key() << "," << ( *itBool ? "1" : "0" ) << endl; -- cgit v0.9.0.2