Commit b4945364 authored by Ramon Buldó's avatar Ramon Buldó

Fix compilation with icu 61.1

Closes #139
parent 2aae76c2
......@@ -56,17 +56,17 @@ EnabledLocalesModel::data( const QModelIndex& index, int role ) const
return QVariant();
const QString& localeCode = m_locales[index.row()];
Locale locale( localeCode.toLatin1() );
icu::Locale locale( localeCode.toLatin1() );
// Get language and country in current system locale
UnicodeString uDisplayLanguage;
UnicodeString uDisplayCountry;
icu::UnicodeString uDisplayLanguage;
icu::UnicodeString uDisplayCountry;
locale.getDisplayLanguage( locale, uDisplayLanguage );
locale.getDisplayCountry( locale, uDisplayCountry );
// Capitalize language and country
UErrorCode status;
BreakIterator* titleIterator = BreakIterator::createTitleInstance( locale, status );
icu::BreakIterator* titleIterator = icu::BreakIterator::createTitleInstance( locale, status );
uDisplayLanguage = uDisplayLanguage.toTitle( titleIterator );
uDisplayCountry = uDisplayCountry.toTitle( titleIterator );
......@@ -339,7 +339,7 @@ EnabledLocalesModel::locales() const
icu::UnicodeString
EnabledLocalesModel::qStringToUnicodeString( const QString& sourceStr )
{
return UnicodeString( static_cast<const ushort*>( sourceStr.utf16() ),
return icu::UnicodeString( static_cast<const ushort*>( sourceStr.utf16() ),
sourceStr.length() );
}
......
......@@ -168,16 +168,16 @@ SupportedLocalesModel::init( SupportedLocalesItem* parent )
QStringList localeList { LanguageCommon::supportedLocales() };
foreach ( const QString localeString, localeList )
{
Locale locale( localeString.toLatin1() );
icu::Locale locale( localeString.toLatin1() );
// Get language and country in current system locale
UnicodeString uDisplayLanguage;
UnicodeString uDisplayCountry;
icu::UnicodeString uDisplayLanguage;
icu::UnicodeString uDisplayCountry;
locale.getDisplayLanguage( locale, uDisplayLanguage );
locale.getDisplayCountry( locale, uDisplayCountry );
// Capitalize language and country
UErrorCode status;
BreakIterator* titleIterator = BreakIterator::createTitleInstance( locale, status );
icu::BreakIterator* titleIterator = icu::BreakIterator::createTitleInstance( locale, status );
uDisplayLanguage = uDisplayLanguage.toTitle( titleIterator );
uDisplayCountry = uDisplayCountry.toTitle( titleIterator );
......@@ -240,7 +240,7 @@ SupportedLocalesModel::init( SupportedLocalesItem* parent )
icu::UnicodeString
SupportedLocalesModel::qStringToUnicodeString( const QString& sourceStr )
{
return UnicodeString( static_cast<const ushort*>( sourceStr.utf16() ),
return icu::UnicodeString( static_cast<const ushort*>( sourceStr.utf16() ),
sourceStr.length() );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment