[libcalamares] Apply coding style

This commit is contained in:
Adriaan de Groot 2020-03-24 22:57:36 +01:00
parent 08b5012946
commit 177d6fe861
2 changed files with 24 additions and 17 deletions

View file

@ -239,7 +239,8 @@ CStringListModel::CStringListModel( CStringPairList l )
{
}
void CStringListModel::setList(CalamaresUtils::Locale::CStringPairList l)
void
CStringListModel::setList( CalamaresUtils::Locale::CStringPairList l )
{
beginResetModel();
m_list = l;
@ -273,7 +274,9 @@ void
CStringListModel::setCurrentIndex( const int& index )
{
if ( ( index < 0 ) || ( index >= m_list.count() ) )
{
return;
}
m_currentIndex = index;
emit currentIndexChanged();

View file

@ -163,15 +163,19 @@ public:
inline int indexOf( const QString& key )
{
const auto it = std::find_if(m_list.constBegin(), m_list.constEnd(), [&](const CalamaresUtils::Locale::CStringPair *item) -> bool
{
const auto it = std::find_if(
m_list.constBegin(), m_list.constEnd(), [&]( const CalamaresUtils::Locale::CStringPair* item ) -> bool {
return item->key() == key;
} );
if ( it != m_list.constEnd() )
{
return std::distance( m_list.constBegin(), it );
else return -1;
}
else
{
return -1;
}
}