mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 01:15:38 -04:00
[welcome] Another find() overload
- Also find a specific locale - While here, apply Calamares coding style
This commit is contained in:
parent
314aee8d68
commit
0c868dbd17
2 changed files with 33 additions and 20 deletions
|
@ -92,5 +92,17 @@ LocaleModel::find(std::function<bool (const LocaleLabel &)> predicate) const
|
||||||
int
|
int
|
||||||
LocaleModel::find( std::function<bool ( const QLocale& )> predicate ) const
|
LocaleModel::find( std::function<bool ( const QLocale& )> predicate ) const
|
||||||
{
|
{
|
||||||
return find( [&]( const LocaleLabel& l ){ return predicate( l.locale() ); } );
|
return find( [&]( const LocaleLabel& l )
|
||||||
|
{
|
||||||
|
return predicate( l.locale() );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
LocaleModel::find( const QLocale& locale ) const
|
||||||
|
{
|
||||||
|
return find( [&]( const LocaleLabel& l )
|
||||||
|
{
|
||||||
|
return locale == l.locale();
|
||||||
|
} );
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,7 @@ public:
|
||||||
*/
|
*/
|
||||||
int find( std::function<bool( const QLocale& )> predicate ) const;
|
int find( std::function<bool( const QLocale& )> predicate ) const;
|
||||||
int find( std::function<bool( const LocaleLabel& )> predicate ) const;
|
int find( std::function<bool( const LocaleLabel& )> predicate ) const;
|
||||||
|
int find( const QLocale& ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVector< LocaleLabel > m_locales;
|
QVector< LocaleLabel > m_locales;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue