mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 02:45:44 -05:00
[locale] Factor out a simple lambda
- If this was handed to an algorithm it would make more sense as a lambda
This commit is contained in:
parent
3093f635e2
commit
5a24e45e3b
1 changed files with 12 additions and 12 deletions
|
@ -127,6 +127,18 @@ LocalePage::updateLocaleLabels()
|
|||
m_formatsLabel->setText( labels.second );
|
||||
}
|
||||
|
||||
static inline bool
|
||||
containsLocation( const QList< LocaleGlobal::Location >& locations, const QString& zone )
|
||||
{
|
||||
for ( const LocaleGlobal::Location& location : locations )
|
||||
{
|
||||
if ( location.zone == zone )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
LocalePage::init( const QString& initialRegion, const QString& initialZone, const QString& localeGenPath )
|
||||
|
@ -150,18 +162,6 @@ LocalePage::init( const QString& initialRegion, const QString& initialZone, cons
|
|||
|
||||
m_regionCombo->currentIndexChanged( m_regionCombo->currentIndex() );
|
||||
|
||||
// Default location
|
||||
auto containsLocation = []( const QList< LocaleGlobal::Location >& locations, const QString& zone ) -> bool {
|
||||
for ( const LocaleGlobal::Location& location : locations )
|
||||
{
|
||||
if ( location.zone == zone )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
if ( keys.contains( initialRegion ) && containsLocation( regions.value( initialRegion ), initialZone ) )
|
||||
{
|
||||
m_tzWidget->setCurrentLocation( initialRegion, initialZone );
|
||||
|
|
Loading…
Add table
Reference in a new issue