From 2709d179f9fece477db78f0ef9a4ed8bb7b43c0e Mon Sep 17 00:00:00 2001 From: Holger Schroeder Date: Fri, 10 Sep 2010 16:20:08 +0200 Subject: Changes: Fix some krazy issues RevBy: TrustMe --- src/corelib/i18n/mlocale.cpp | 15 ++++++++------- src/corelib/i18n/mlocationdatabase.cpp | 6 +++--- src/corelib/i18n/mlocationdatabase.h | 4 ++-- 3 files changed, 13 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/corelib/i18n/mlocale.cpp b/src/corelib/i18n/mlocale.cpp index 9576bad4..e6616092 100644 --- a/src/corelib/i18n/mlocale.cpp +++ b/src/corelib/i18n/mlocale.cpp @@ -364,7 +364,8 @@ void MLocalePrivate::dateFormatTo12h(icu::DateFormat *df) const bool amPmMarkerWritten = false; QString language = categoryName(MLocale::MLcTime); bool writeAmPmMarkerBeforeHours = false; - if (language.startsWith("ja") || language.startsWith("zh")) + if (language.startsWith( QLatin1String("ja")) + || language.startsWith( QLatin1String("zh"))) writeAmPmMarkerBeforeHours = true; if (writeAmPmMarkerBeforeHours) { for (int i = 0; i < icuFormatQString.size(); ++i) { @@ -1006,7 +1007,7 @@ void MLocalePrivate::setCategoryLocale(MLocale *mlocale, _telephoneLocale = localeName; // here we set the phone number grouping depending on the // setting in the gconf key - if ( _telephoneLocale.startsWith( "en_US" ) ) { + if ( _telephoneLocale.startsWith( QLatin1String( "en_US" ) ) ) { _phoneNumberGrouping = MLocale::NorthAmericanPhoneNumberGrouping; } else { _phoneNumberGrouping = MLocale::NoPhoneNumberGrouping; @@ -2837,7 +2838,7 @@ QString MLocale::formatPhoneNumber( const QString& phoneNumber, // system setting for the grouping if ( tmpGrouping == DefaultPhoneNumberGrouping ) { - if ( d->_telephoneLocale.startsWith( "en_US" ) ) { + if ( d->_telephoneLocale.startsWith( QLatin1String( "en_US" ) ) ) { tmpGrouping = NorthAmericanPhoneNumberGrouping; } else { tmpGrouping = NoPhoneNumberGrouping; @@ -3014,7 +3015,7 @@ QString MLocalePrivate::formatPhoneNumber( const QString& phoneNumber, // 00 is not a valid country calling code in north america // -> do not do grouping in this case at all if ( ( grouping == MLocale::NorthAmericanPhoneNumberGrouping ) - && phoneNumber.startsWith( "00" ) ) + && phoneNumber.startsWith( QLatin1String( "00" ) ) ) { return phoneNumber; } @@ -3036,13 +3037,13 @@ QString MLocalePrivate::formatPhoneNumber( const QString& phoneNumber, result.append( '+' ); remaining.remove( 0, 1 ); } - else if ( remaining.startsWith( "00" ) ) + else if ( remaining.startsWith( QLatin1String( "00" ) ) ) { foundCountryCodeIndicator = true; result.append( "00 " ); remaining.remove( 0, 2 ); } - else if ( remaining.startsWith( "011" ) ) + else if ( remaining.startsWith( QLatin1String( "011" ) ) ) { foundCountryCodeIndicator = true; result.append( "011 " ); @@ -3108,7 +3109,7 @@ QString MLocalePrivate::formatPhoneNumber( const QString& phoneNumber, return result; } // 11 is an invalid code, so disable grouping for this case - else if ( remaining.startsWith( "11" ) ) + else if ( remaining.startsWith( QLatin1String( "11" ) ) ) { result.append( remaining ); return result; diff --git a/src/corelib/i18n/mlocationdatabase.cpp b/src/corelib/i18n/mlocationdatabase.cpp index 26f977c1..e2b2aa54 100644 --- a/src/corelib/i18n/mlocationdatabase.cpp +++ b/src/corelib/i18n/mlocationdatabase.cpp @@ -212,7 +212,7 @@ QList MLocationDatabase::countries() QList list; - foreach( MCountry country, d->countries ) + foreach( const MCountry& country, d->countries ) { list.append( country ); } @@ -226,7 +226,7 @@ QList MLocationDatabase::cities() QList list; - foreach( MCity city, d->cities ) + foreach( const MCity& city, d->cities ) { list.append( city ); } @@ -240,7 +240,7 @@ QList MLocationDatabase::citiesInCountry( const QString& countryKey ) QList list; - foreach( MCity city, d->cities ) + foreach( const MCity& city, d->cities ) { if ( city.country().key() == countryKey ) { diff --git a/src/corelib/i18n/mlocationdatabase.h b/src/corelib/i18n/mlocationdatabase.h index 5a0052e6..f447dda3 100644 --- a/src/corelib/i18n/mlocationdatabase.h +++ b/src/corelib/i18n/mlocationdatabase.h @@ -17,8 +17,8 @@ ** ****************************************************************************/ -#ifndef MCITYLIST_H -#define MCITYLIST_H +#ifndef MLOCATIONDATABASE_H +#define MLOCATIONDATABASE_H #include "mexport.h" -- cgit v1.2.3