mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-02 20:05:37 -04:00
[keyboard] Sanity in setCurrentIndex() parameters
This commit is contained in:
parent
9e141636c5
commit
0bf28b0b94
2 changed files with 7 additions and 4 deletions
|
@ -183,15 +183,18 @@ KeyboardLayoutModel::roleNames() const
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
KeyboardLayoutModel::setCurrentIndex( const int& index )
|
KeyboardLayoutModel::setCurrentIndex( int index )
|
||||||
{
|
{
|
||||||
if ( index >= m_layouts.count() || index < 0 )
|
if ( index >= m_layouts.count() || index < 0 )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_currentIndex = index;
|
if ( m_currentIndex != index )
|
||||||
emit currentIndexChanged( m_currentIndex );
|
{
|
||||||
|
m_currentIndex = index;
|
||||||
|
emit currentIndexChanged( m_currentIndex );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -114,7 +114,7 @@ public:
|
||||||
|
|
||||||
QVariant data( const QModelIndex& index, int role ) const override;
|
QVariant data( const QModelIndex& index, int role ) const override;
|
||||||
|
|
||||||
void setCurrentIndex( const int& index );
|
void setCurrentIndex( int index );
|
||||||
int currentIndex() const;
|
int currentIndex() const;
|
||||||
const QPair< QString, KeyboardGlobal::KeyboardInfo > item( const int& index ) const;
|
const QPair< QString, KeyboardGlobal::KeyboardInfo > item( const int& index ) const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue