Author: dmacvicar Date: Fri Nov 30 12:03:16 2007 New Revision: 42535 URL: http://svn.opensuse.org/viewcvs/yast?rev=42535&view=rev Log: Ported QY2Settings Modified: branches/tmp/coolo/qt4-port/src/CMakeLists.txt branches/tmp/coolo/qt4-port/src/QY2Settings.cc Modified: branches/tmp/coolo/qt4-port/src/CMakeLists.txt URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/CMakeLists.txt?rev=42535&r1=42534&r2=42535&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/CMakeLists.txt (original) +++ branches/tmp/coolo/qt4-port/src/CMakeLists.txt Fri Nov 30 12:03:16 2007 @@ -2,7 +2,7 @@ ADD_DEFINITIONS( -DY2LOG=\\\"QT4\\\" ${QT_DEFINITIONS} --DQT3_SUPPORT +#-DQT3_SUPPORT -DQT_LOCALEDIR=\\\"${CMAKE_INSTALL_PREFIX}/share/qt4/translations\\\" -DICONDIR=\\"${Y2QT_ICONDIR}\\" -DLOCALEDIR=\\\"${Y2QT_LOCALEDIR}\\\" Modified: branches/tmp/coolo/qt4-port/src/QY2Settings.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/QY2Settings.cc?rev=42535&r1=42534&r2=42535&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/QY2Settings.cc (original) +++ branches/tmp/coolo/qt4-port/src/QY2Settings.cc Fri Nov 30 12:03:16 2007 @@ -112,7 +112,7 @@ if ( it == _currentSection->constEnd() ) return fallback; - return it.data(); + return it.value(); } @@ -156,8 +156,8 @@ if ( ! file.open( QIODevice::ReadOnly ) ) { - cerr << "Can't load settings from " << (const char *) _fileName - << ": " << (const char *) file.errorString() + cerr << "Can't load settings from " << qPrintable(_fileName) + << ": " << qPrintable(file.errorString()) << endl; _readError = true; @@ -172,7 +172,7 @@ while ( ! file.atEnd() ) { - line = str.readLine().stripWhiteSpace(); + line = str.readLine().trimmed(); lineCount++; @@ -200,8 +200,8 @@ { // key=value pair - QString key = line.section( "=", 0, 0 ).stripWhiteSpace(); - QString value = line.section( "=", 1, 1 ).stripWhiteSpace(); + QString key = line.section( "=", 0, 0 ).trimmed(); + QString value = line.section( "=", 1, 1 ).trimmed(); value.replace( QRegExp( "^\"" ), "" ); // strip leading " value.replace( QRegExp( "\"$" ), "" ); // strip trailing " @@ -213,7 +213,7 @@ else { qWarning( "%s:%d: Syntax error: %s", - (const char *) _fileName, lineCount, (const char *) line ); + qPrintable( _fileName), lineCount, qPrintable(line) ); } } @@ -232,8 +232,8 @@ if ( ! file.open( QIODevice::WriteOnly ) ) { - cerr << "Can't save settings to " << (const char *) _fileName - << ": " << (const char *) file.errorString() + cerr << "Can't save settings to " << qPrintable(_fileName) + << ": " << qPrintable(file.errorString()) << endl; return false; @@ -274,7 +274,7 @@ it != sect->end(); ++it ) { - QString value = it.data(); + QString value = it.value(); value.replace( "\"", "\\\"" ); // Escape embedded " with \" str << it.key() << "= \"" << value << "\"" << endl; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org