[keyboard] Sanity in setCurrentIndex() parameters
This commit is contained in:
parent
9e141636c5
commit
0bf28b0b94
@ -183,16 +183,19 @@ KeyboardLayoutModel::roleNames() const
|
||||
}
|
||||
|
||||
void
|
||||
KeyboardLayoutModel::setCurrentIndex( const int& index )
|
||||
KeyboardLayoutModel::setCurrentIndex( int index )
|
||||
{
|
||||
if ( index >= m_layouts.count() || index < 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_currentIndex != index )
|
||||
{
|
||||
m_currentIndex = index;
|
||||
emit currentIndexChanged( m_currentIndex );
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
KeyboardLayoutModel::currentIndex() const
|
||||
|
@ -114,7 +114,7 @@ public:
|
||||
|
||||
QVariant data( const QModelIndex& index, int role ) const override;
|
||||
|
||||
void setCurrentIndex( const int& index );
|
||||
void setCurrentIndex( int index );
|
||||
int currentIndex() const;
|
||||
const QPair< QString, KeyboardGlobal::KeyboardInfo > item( const int& index ) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user