From 8d9f75ffba9566f6aa04cb7844902141fd125e94 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 7 Jun 2017 10:15:13 -0400 Subject: [PATCH] Keyboard: refactor type declaration --- src/modules/keyboard/KeyboardLayoutModel.cpp | 5 +++-- src/modules/keyboard/keyboardwidget/keyboardglobal.h | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/modules/keyboard/KeyboardLayoutModel.cpp b/src/modules/keyboard/KeyboardLayoutModel.cpp index 9f045043e..63989819c 100644 --- a/src/modules/keyboard/KeyboardLayoutModel.cpp +++ b/src/modules/keyboard/KeyboardLayoutModel.cpp @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2016, Teo Mrnjavac + * Copyright 2017, Adriaan de Groot * * 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() ) ); diff --git a/src/modules/keyboard/keyboardwidget/keyboardglobal.h b/src/modules/keyboard/keyboardwidget/keyboardglobal.h index 8710fdaa2..965e0828f 100644 --- a/src/modules/keyboard/keyboardwidget/keyboardglobal.h +++ b/src/modules/keyboard/keyboardwidget/keyboardglobal.h @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014, Teo Mrnjavac + * Copyright 2017, Adriaan de Groot * * Originally from the Manjaro Installation Framework * by Roland Singer @@ -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