Author: dmacvicar Date: Fri Nov 30 12:03:19 2007 New Revision: 42537 URL: http://svn.opensuse.org/viewcvs/yast?rev=42537&view=rev Log: ported YQApplication and utf8 Modified: branches/tmp/coolo/qt4-port/src/YQApplication.cc branches/tmp/coolo/qt4-port/src/utf8.h Modified: branches/tmp/coolo/qt4-port/src/YQApplication.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQAppli... ============================================================================== --- branches/tmp/coolo/qt4-port/src/YQApplication.cc (original) +++ branches/tmp/coolo/qt4-port/src/YQApplication.cc Fri Nov 30 12:03:19 2007 @@ -78,7 +78,7 @@ QString language = QLocale::system().name(); QString transFile = QString( "qt_%1.qm") - .arg( language.lower().replace('_','-') ); + .arg( language.toLower().replace('_','-') ); if ( path.isEmpty() ) { @@ -95,19 +95,19 @@ if ( _qtTranslations->isEmpty() ) { // try fallback - transFile = QString( "qt_%1.qm").arg( language.lower().left(2) ); + transFile = QString( "qt_%1.qm").arg( language.toLower().left(2) ); _qtTranslations->load( transFile, path ); } if ( _qtTranslations->isEmpty() ) { y2warning( "Can't load translations for predefined Qt dialogs from %s/%s", - (const char *) path, (const char *) transFile ); + qPrintable(path), qPrintable(transFile) ); } else { y2milestone( "Loaded translations for predefined Qt dialogs from %s/%s", - (const char *) path, (const char *) transFile ); + qPrintable(path), qPrintable(transFile) ); qApp->installTranslator( _qtTranslations ); } @@ -117,12 +117,12 @@ if ( ( language.startsWith( "ar" ) || // Arabic language.startsWith( "he" ) ) // Hebrew - && ! qApp->reverseLayout() ) + && ! (qApp->layoutDirection() == Qt::RightToLeft) ) { y2warning( "Using fallback rule for reverse layout for language '%s'", - (const char *) language ); + qPrintable(language) ); - qApp->setReverseLayout( true ); + qApp->setLayoutDirection( Qt::RightToLeft ); } } @@ -138,9 +138,9 @@ Q_CHECK_PTR( _langFonts ); if ( _langFonts->readError() ) - y2error( "Error reading %s", (const char *) _langFonts->fileName() ); + y2error( "Error reading %s", qPrintable(_langFonts->fileName()) ); else - y2milestone( "%s read OK", (const char *) _langFonts->fileName() ); + y2milestone( "%s read OK", qPrintable(_langFonts->fileName()) ); } QString lang = language.c_str(); @@ -161,25 +161,25 @@ if ( _langFonts->hasKey( fontKey( lang ) ) ) { _fontFamily = _langFonts->get( fontKey( lang ), "Sans Serif" ); - y2milestone( "%s = "%s"", (const char *) fontKey( lang ), (const char *) _fontFamily ); + y2milestone( "%s = "%s"", qPrintable(fontKey( lang )), qPrintable(_fontFamily) ); } else { _fontFamily = _langFonts->get( fontKey( "" ), "Sans Serif" ); y2milestone( "Using fallback for %s: font = "%s"", - (const char *) lang, (const char *) _fontFamily ); + qPrintable(lang), qPrintable(_fontFamily) ); } if ( _fontFamily != oldFontFamily && ! _fontFamily.isEmpty() ) { - y2milestone( "New font family: %s", _fontFamily.latin1() ); + y2milestone( "New font family: %s", qPrintable(_fontFamily) ); deleteFonts(); int size = qApp->font().pointSize(); QFont font( _fontFamily ); font.setPointSize( size ); - qApp->setFont( font, true ); // font, informWidgets + qApp->setFont(font); // font, informWidgets y2milestone( "Reloading fonts - now using "%s"", - (const char *) font.toString() ); + qPrintable(font.toString()) ); } else { @@ -224,9 +224,9 @@ _currentFont->setWeight( QFont::Normal ); y2milestone( "Loaded %d pixel font: %s", _autoNormalFontSize, - (const char *) _currentFont->toString() ); + qPrintable(_currentFont->toString()) ); - qApp->setFont( * _currentFont, true ); // font, informWidgets + qApp->setFont( * _currentFont); // font, informWidgets } else { @@ -270,7 +270,7 @@ _headingFont->setWeight( QFont::Bold ); y2milestone( "Loaded %d pixel bold font: %s", _autoHeadingFontSize, - (const char *) _headingFont->toString() ); + qPrintable(_headingFont->toString()) ); } else { Modified: branches/tmp/coolo/qt4-port/src/utf8.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/utf8.h?... ============================================================================== --- branches/tmp/coolo/qt4-port/src/utf8.h (original) +++ branches/tmp/coolo/qt4-port/src/utf8.h Fri Nov 30 12:03:19 2007 @@ -35,7 +35,7 @@ if ( str.isEmpty() ) return std::string( "" ); else - return std::string( str.utf8().data() ); + return std::string( str.toUtf8().data() ); } #endif // utf8_h -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org