Keyboard: refactor type declaration

This commit is contained in:
Adriaan de Groot 2017-06-07 10:15:13 -04:00
parent 2c0802d18e
commit 8d9f75ffba
2 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2016, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -59,9 +60,9 @@ KeyboardLayoutModel::data( const QModelIndex& index, int role ) const
void
KeyboardLayoutModel::init()
{
QMap< QString, KeyboardGlobal::KeyboardInfo > layouts =
KeyboardGlobal::LayoutsMap layouts =
KeyboardGlobal::getKeyboardLayouts();
for ( QMap< QString, KeyboardGlobal::KeyboardInfo >::const_iterator it = layouts.constBegin();
for ( KeyboardGlobal::LayoutsMap::const_iterator it = layouts.constBegin();
it != layouts.constEnd(); ++it )
{
m_layouts.append( qMakePair( it.key(), it.value() ) );

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Originally from the Manjaro Installation Framework
* by Roland Singer <roland@manjaro.org>
@ -44,12 +45,15 @@ public:
QMap< QString, QString > variants;
};
static QMap< QString, KeyboardInfo > getKeyboardLayouts();
using LayoutsMap = QMap< QString, KeyboardInfo >;
static LayoutsMap getKeyboardLayouts();
static QMap< QString, QString > getKeyboardModels();
private:
static QMap< QString, QString > parseKeyboardModels(QString filepath);
static QMap< QString, KeyboardInfo > parseKeyboardLayouts(QString filepath);
static LayoutsMap parseKeyboardLayouts(QString filepath);
};
#endif // KEYBOARDGLOBAL_H