-rw-r--r-- | microkde/kconfig.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/microkde/kconfig.cpp b/microkde/kconfig.cpp index b9cf2f1..9598274 100644 --- a/microkde/kconfig.cpp +++ b/microkde/kconfig.cpp @@ -260,33 +260,33 @@ void KConfig::writeEntry( const QString & e , const QFont & f ) void KConfig::writeEntry( const QString &key, const QDateTime &dt ) { mDateTimeMap.insert( mGroup + key, dt ); } void KConfig::load() { QFile f( mFileName ); if ( !f.open( IO_ReadOnly ) ) { - //qDebug("KConfig: could not open file %s ",mFileName.latin1() ); + qDebug("KConfig: could not open file %s ",mFileName.latin1() ); return; } mBoolMap.clear(); mStringMap.clear(); QTextStream t( &f ); - + t.setEncoding( QTextStream::Latin1 ); QString line = t.readLine(); while ( !line.isNull() ) { QStringList tokens = QStringList::split( ",", line ); if ( tokens[0] == "bool" ) { bool value = false; if ( tokens[2] == "1" ) value = true; mBoolMap.insert( tokens[1], value ); } else if ( tokens[0] == "QString" ) { QString value = tokens[2]; mStringMap.insert( tokens[1], value ); } else if ( tokens[0] == "QDateTime" ) { @@ -319,25 +319,25 @@ void KConfig::sync() QString dir=path.directory(); KStandardDirs::makeDir(dir); QFile f( mFileName ); if ( !f.open( IO_WriteOnly ) ) { qDebug("KConfig::sync() Can't open file %s ",mFileName.latin1() ); return; } QTextStream t( &f ); - + t.setEncoding( QTextStream::Latin1 ); QMap<QString,bool>::ConstIterator itBool; for( itBool = mBoolMap.begin(); itBool != mBoolMap.end(); ++itBool ) { t << "bool," << itBool.key() << "," << ( *itBool ? "1" : "0" ) << endl; } QMap<QString,QString>::ConstIterator itString; for( itString = mStringMap.begin(); itString != mStringMap.end(); ++itString ) { t << "QString," << itString.key() << "," << (*itString ) << endl; } QMap<QString,QDateTime>::ConstIterator itDateTime; for( itDateTime = mDateTimeMap.begin(); itDateTime != mDateTimeMap.end(); ++itDateTime ) { |