summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/config.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/library/config.cpp b/library/config.cpp
index 0bfb476..664ca34 100644
--- a/library/config.cpp
+++ b/library/config.cpp
@@ -458,28 +458,28 @@ void Config::write( const QString &fn )
458 QFile f( strNewFile ); 458 QFile f( strNewFile );
459 if ( !f.open( IO_WriteOnly|IO_Raw ) ) { 459 if ( !f.open( IO_WriteOnly|IO_Raw ) ) {
460 qWarning( "could not open for writing `%s'", strNewFile.latin1() ); 460 qWarning( "could not open for writing `%s'", strNewFile.latin1() );
461 git = groups.end(); 461 git = groups.end();
462 return; 462 return;
463 } 463 }
464 464
465 QString str; 465 QString str;
466 QCString cstr; 466 QCString cstr;
467 QMap< QString, ConfigGroup >::Iterator g_it = groups.begin(); 467 QMap< QString, ConfigGroup >::Iterator g_it = groups.begin();
468 468
469 for ( ; g_it != groups.end(); ++g_it ) { 469 for ( ; g_it != groups.end(); ++g_it ) {
470 str += "[" + g_it.key() + "]\n"; 470 str += "[" + g_it.key() + "]\n";
471 ConfigGroup::Iterator e_it = ( *g_it ).begin(); 471 ConfigGroup::Iterator e_it = ( *g_it ).begin();
472 for ( ; e_it != ( *g_it ).end(); ++e_it ) 472 for ( ; e_it != ( *g_it ).end(); ++e_it )
473 str += e_it.key() + " = " + *e_it + "\n"; 473 str += e_it.key() + " = " + *e_it + "\n";
474 } 474 }
475 cstr = str.utf8(); 475 cstr = str.utf8();
476 476
477 int total_length; 477 int total_length;
478 total_length = f.writeBlock( cstr.data(), cstr.length() ); 478 total_length = f.writeBlock( cstr.data(), cstr.length() );
479 if ( total_length != int(cstr.length()) ) { 479 if ( total_length != int(cstr.length()) ) {
480 QMessageBox::critical( 0, QObject::tr("Out of Space"), 480 QMessageBox::critical( 0, QObject::tr("Out of Space"),
481 QObject::tr("There was a problem creating\nConfiguration Information \nfor this program.\n\nPlease free up some space and\ntry again.") ); 481 QObject::tr("There was a problem creating\nConfiguration Information \nfor this program.\n\nPlease free up some space and\ntry again.") );
482 f.close(); 482 f.close();
483 QFile::remove( strNewFile ); 483 QFile::remove( strNewFile );
484 return; 484 return;
485 } 485 }
@@ -549,25 +549,25 @@ void Config::read()
549 } 549 }
550 } 550 }
551} 551}
552 552
553/*! 553/*!
554 \internal 554 \internal
555*/ 555*/
556bool Config::parse( const QString &l ) 556bool Config::parse( const QString &l )
557{ 557{
558 QString line = l.stripWhiteSpace(); 558 QString line = l.stripWhiteSpace();
559 559
560 if ( line [0] == QChar ( '#' )) 560 if ( line [0] == QChar ( '#' ))
561 return true; // ignore comments 561 return true; // ignore comments
562 562
563 if ( line[ 0 ] == QChar( '[' ) ) { 563 if ( line[ 0 ] == QChar( '[' ) ) {
564 QString gname = line; 564 QString gname = line;
565 gname = gname.remove( 0, 1 ); 565 gname = gname.remove( 0, 1 );
566 if ( gname[ (int)gname.length() - 1 ] == QChar( ']' ) ) 566 if ( gname[ (int)gname.length() - 1 ] == QChar( ']' ) )
567 gname = gname.remove( gname.length() - 1, 1 ); 567 gname = gname.remove( gname.length() - 1, 1 );
568 git = groups.insert( gname, ConfigGroup() ); 568 git = groups.insert( gname, ConfigGroup() );
569 } else if ( !line.isEmpty() ) { 569 } else if ( !line.isEmpty() ) {
570 if ( git == groups.end() ) 570 if ( git == groups.end() )
571 return FALSE; 571 return FALSE;
572 int eq = line.find( '=' ); 572 int eq = line.find( '=' );
573 if ( eq == -1 ) 573 if ( eq == -1 )