aboutsummaryrefslogtreecommitdiff
path: root/src/corelib/i18n
diff options
context:
space:
mode:
authorHolger Schroeder <holger.schroeder.ext@basyskom.de>2010-09-10 16:20:08 +0200
committerJörgen Scheibengruber <jorgen.scheibengruber@nokia.com>2010-09-13 13:46:25 +0300
commit2709d179f9fece477db78f0ef9a4ed8bb7b43c0e (patch)
tree8d7f7199507701a3914d1ee5e664ce0259eebbbc /src/corelib/i18n
parent5e997484f91d17cef5c42e2a5a954337c2924b96 (diff)
Changes: Fix some krazy issues
RevBy: TrustMe
Diffstat (limited to 'src/corelib/i18n')
-rw-r--r--src/corelib/i18n/mlocale.cpp15
-rw-r--r--src/corelib/i18n/mlocationdatabase.cpp6
-rw-r--r--src/corelib/i18n/mlocationdatabase.h4
3 files changed, 13 insertions, 12 deletions
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<MCountry> MLocationDatabase::countries()
QList<MCountry> list;
- foreach( MCountry country, d->countries )
+ foreach( const MCountry& country, d->countries )
{
list.append( country );
}
@@ -226,7 +226,7 @@ QList<MCity> MLocationDatabase::cities()
QList<MCity> list;
- foreach( MCity city, d->cities )
+ foreach( const MCity& city, d->cities )
{
list.append( city );
}
@@ -240,7 +240,7 @@ QList<MCity> MLocationDatabase::citiesInCountry( const QString& countryKey )
QList<MCity> 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"