[keyboard] Restore the notion of PC105 default index

This commit is contained in:
Adriaan de Groot 2020-10-28 13:52:30 +01:00
parent 6aedf4401f
commit 193efe1710
2 changed files with 10 additions and 1 deletions

View file

@ -19,11 +19,17 @@ KeyboardModelsModel::KeyboardModelsModel( QObject* parent )
{
// The models map is from human-readable names (!) to xkb identifier
const auto models = KeyboardGlobal::getKeyboardModels();
int index = 0;
for ( const auto& key : models.keys() )
{
// So here *key* is the key in the map, which is the human-readable thing,
// while the struct fields are xkb-id, and human-readable
m_list << ModelInfo { models[ key ], key };
if ( models[ key ] == "pc105" )
{
m_defaultPC105 = index;
}
index++;
}
cDebug() << "Loaded" << m_list.count() << "keyboard models";