[welcome] Fix build, reduce redundancy
- constexpr isn't applicable because of non-trivial destructor - May as well only create " (%1)" once. FIXES #938
This commit is contained in:
parent
e5b599fbe3
commit
42f5ed5d41
@ -52,6 +52,8 @@ if(NOT CMAKE_VERSION VERSION_LESS "3.10.0")
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" )
|
||||||
|
|
||||||
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
||||||
message( STATUS "Found Clang ${CMAKE_CXX_COMPILER_VERSION}, setting up Clang-specific compiler flags." )
|
message( STATUS "Found Clang ${CMAKE_CXX_COMPILER_VERSION}, setting up Clang-specific compiler flags." )
|
||||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" )
|
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" )
|
||||||
|
@ -143,12 +143,13 @@ struct LocaleLabel
|
|||||||
|
|
||||||
if ( locale.contains( '_' ) && QLocale::countriesForLanguage( m_locale.language() ).count() > 2 )
|
if ( locale.contains( '_' ) && QLocale::countriesForLanguage( m_locale.language() ).count() > 2 )
|
||||||
{
|
{
|
||||||
sortKey.append( QString( " (%1)" )
|
QLatin1Literal countrySuffix( " (%1)" );
|
||||||
.arg( QLocale::countryToString( m_locale.country() ) ) );
|
|
||||||
|
sortKey.append( QString( countrySuffix ).arg( QLocale::countryToString( m_locale.country() ) ) );
|
||||||
|
|
||||||
// If the language name is RTL, make this parenthetical addition RTL as well.
|
// If the language name is RTL, make this parenthetical addition RTL as well.
|
||||||
QString countryFormat = label.isRightToLeft() ? QString( QChar( 0x202B ) ) : QString();
|
QString countryFormat = label.isRightToLeft() ? QString( QChar( 0x202B ) ) : QString();
|
||||||
countryFormat.append( QLatin1String( " (%1)" ) );
|
countryFormat.append( countrySuffix );
|
||||||
label.append( countryFormat.arg( m_locale.nativeCountryName() ) );
|
label.append( countryFormat.arg( m_locale.nativeCountryName() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,7 +180,7 @@ struct LocaleLabel
|
|||||||
* en_US and en (American English) is defined as English. The Queen's
|
* en_US and en (American English) is defined as English. The Queen's
|
||||||
* English -- proper English -- is relegated to non-English status.
|
* English -- proper English -- is relegated to non-English status.
|
||||||
*/
|
*/
|
||||||
constexpr bool isEnglish() const
|
bool isEnglish() const
|
||||||
{
|
{
|
||||||
return m_localeId == QLatin1Literal( "en_US" ) || m_localeId == QLatin1Literal( "en" );
|
return m_localeId == QLatin1Literal( "en_US" ) || m_localeId == QLatin1Literal( "en" );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user