diff --git a/src/modules/keyboard/KeyboardPage.cpp b/src/modules/keyboard/KeyboardPage.cpp index cb8aada5b..2be897e58 100644 --- a/src/modules/keyboard/KeyboardPage.cpp +++ b/src/modules/keyboard/KeyboardPage.cpp @@ -84,49 +84,20 @@ KeyboardPage::KeyboardPage( Config* config, QWidget* parent ) connect( ui->layoutSelector->selectionModel(), &QItemSelectionModel::currentChanged, - this, - &KeyboardPage::layoutChangedByUser ); - connect( config->keyboardLayouts(), - &KeyboardLayoutModel::currentIndexChanged, - this, - &KeyboardPage::layoutChangedByConfig ); + [this]( const QModelIndex& current ) { m_config->keyboardLayouts()->setCurrentIndex( current.row() ); } ); + connect( config->keyboardLayouts(), &KeyboardLayoutModel::currentIndexChanged, [this]( int index ) { + ui->layoutSelector->setCurrentIndex( m_config->keyboardLayouts()->index( index ) ); + } ); connect( ui->variantSelector->selectionModel(), &QItemSelectionModel::currentChanged, - this, - &KeyboardPage::variantChangedByUser ); - connect( config->keyboardVariants(), - &KeyboardVariantsModel::currentIndexChanged, - this, - &KeyboardPage::variantChangedByConfig ); - + [this]( const QModelIndex& current ) { m_config->keyboardVariants()->setCurrentIndex( current.row() ); } ); + connect( config->keyboardVariants(), &KeyboardVariantsModel::currentIndexChanged, [this]( int index ) { + ui->variantSelector->setCurrentIndex( m_config->keyboardVariants()->index( index ) ); + } ); CALAMARES_RETRANSLATE( ui->retranslateUi( this ); ) } -void -KeyboardPage::layoutChangedByUser( const QModelIndex& current, const QModelIndex& previous ) -{ - m_config->keyboardLayouts()->setCurrentIndex( current.row() ); -} - -void -KeyboardPage::layoutChangedByConfig( int index ) -{ - ui->layoutSelector->setCurrentIndex( m_config->keyboardLayouts()->index( index ) ); -} - -void -KeyboardPage::variantChangedByUser( const QModelIndex& current, const QModelIndex& previous ) -{ - m_config->keyboardVariants()->setCurrentIndex( current.row() ); -} - -void -KeyboardPage::variantChangedByConfig( int index ) -{ - ui->variantSelector->setCurrentIndex( m_config->keyboardVariants()->index( index ) ); -} - KeyboardPage::~KeyboardPage() { delete ui; diff --git a/src/modules/keyboard/KeyboardPage.h b/src/modules/keyboard/KeyboardPage.h index 582b614e3..98925fcad 100644 --- a/src/modules/keyboard/KeyboardPage.h +++ b/src/modules/keyboard/KeyboardPage.h @@ -37,13 +37,6 @@ public: explicit KeyboardPage( Config* config, QWidget* parent = nullptr ); ~KeyboardPage() override; -protected slots: - void layoutChangedByUser( const QModelIndex& current, const QModelIndex& previous ); - void layoutChangedByConfig( int index ); - - void variantChangedByUser( const QModelIndex& current, const QModelIndex& previous ); - void variantChangedByConfig( int index ); - private: Ui::Page_Keyboard* ui; KeyBoardPreview* m_keyboardPreview;