summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-04-15 08:09:42 (UTC)
committer zautrix <zautrix>2005-04-15 08:09:42 (UTC)
commitacb5803cdda97ef1369388eb15eb669e2835c06a (patch) (unidiff)
tree2fa7fa8e4392b7675a03209207470639c2187ca8
parent6a16de9a18235d2ddd771c97a4bb4512b43d181a (diff)
downloadkdepimpi-acb5803cdda97ef1369388eb15eb669e2835c06a.zip
kdepimpi-acb5803cdda97ef1369388eb15eb669e2835c06a.tar.gz
kdepimpi-acb5803cdda97ef1369388eb15eb669e2835c06a.tar.bz2
utf8 fix
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--microkde/kconfig.cpp6
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 )
260 260
261void KConfig::writeEntry( const QString &key, const QDateTime &dt ) 261void KConfig::writeEntry( const QString &key, const QDateTime &dt )
262{ 262{
263 mDateTimeMap.insert( mGroup + key, dt ); 263 mDateTimeMap.insert( mGroup + key, dt );
264} 264}
265 265
266void KConfig::load() 266void KConfig::load()
267{ 267{
268 268
269 269
270 QFile f( mFileName ); 270 QFile f( mFileName );
271 if ( !f.open( IO_ReadOnly ) ) { 271 if ( !f.open( IO_ReadOnly ) ) {
272 //qDebug("KConfig: could not open file %s ",mFileName.latin1() ); 272 qDebug("KConfig: could not open file %s ",mFileName.latin1() );
273 return; 273 return;
274 } 274 }
275 275
276 mBoolMap.clear(); 276 mBoolMap.clear();
277 mStringMap.clear(); 277 mStringMap.clear();
278 278
279 QTextStream t( &f ); 279 QTextStream t( &f );
280 280 t.setEncoding( QTextStream::Latin1 );
281 QString line = t.readLine(); 281 QString line = t.readLine();
282 282
283 while ( !line.isNull() ) { 283 while ( !line.isNull() ) {
284 QStringList tokens = QStringList::split( ",", line ); 284 QStringList tokens = QStringList::split( ",", line );
285 if ( tokens[0] == "bool" ) { 285 if ( tokens[0] == "bool" ) {
286 bool value = false; 286 bool value = false;
287 if ( tokens[2] == "1" ) value = true; 287 if ( tokens[2] == "1" ) value = true;
288 mBoolMap.insert( tokens[1], value ); 288 mBoolMap.insert( tokens[1], value );
289 } else if ( tokens[0] == "QString" ) { 289 } else if ( tokens[0] == "QString" ) {
290 QString value = tokens[2]; 290 QString value = tokens[2];
291 mStringMap.insert( tokens[1], value ); 291 mStringMap.insert( tokens[1], value );
292 } else if ( tokens[0] == "QDateTime" ) { 292 } else if ( tokens[0] == "QDateTime" ) {
@@ -319,25 +319,25 @@ void KConfig::sync()
319 QString dir=path.directory(); 319 QString dir=path.directory();
320 KStandardDirs::makeDir(dir); 320 KStandardDirs::makeDir(dir);
321 321
322 QFile f( mFileName ); 322 QFile f( mFileName );
323 if ( !f.open( IO_WriteOnly ) ) { 323 if ( !f.open( IO_WriteOnly ) ) {
324 324
325 qDebug("KConfig::sync() Can't open file %s ",mFileName.latin1() ); 325 qDebug("KConfig::sync() Can't open file %s ",mFileName.latin1() );
326 326
327 return; 327 return;
328 } 328 }
329 329
330 QTextStream t( &f ); 330 QTextStream t( &f );
331 331 t.setEncoding( QTextStream::Latin1 );
332 QMap<QString,bool>::ConstIterator itBool; 332 QMap<QString,bool>::ConstIterator itBool;
333 for( itBool = mBoolMap.begin(); itBool != mBoolMap.end(); ++itBool ) { 333 for( itBool = mBoolMap.begin(); itBool != mBoolMap.end(); ++itBool ) {
334 t << "bool," << itBool.key() << "," << ( *itBool ? "1" : "0" ) << endl; 334 t << "bool," << itBool.key() << "," << ( *itBool ? "1" : "0" ) << endl;
335 } 335 }
336 336
337 QMap<QString,QString>::ConstIterator itString; 337 QMap<QString,QString>::ConstIterator itString;
338 for( itString = mStringMap.begin(); itString != mStringMap.end(); ++itString ) { 338 for( itString = mStringMap.begin(); itString != mStringMap.end(); ++itString ) {
339 t << "QString," << itString.key() << "," << (*itString ) << endl; 339 t << "QString," << itString.key() << "," << (*itString ) << endl;
340 } 340 }
341 341
342 QMap<QString,QDateTime>::ConstIterator itDateTime; 342 QMap<QString,QDateTime>::ConstIterator itDateTime;
343 for( itDateTime = mDateTimeMap.begin(); itDateTime != mDateTimeMap.end(); ++itDateTime ) { 343 for( itDateTime = mDateTimeMap.begin(); itDateTime != mDateTimeMap.end(); ++itDateTime ) {