From fba8e448bb14ccbdacecac1522509a16af304e08 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Mon, 13 Jun 2016 17:47:54 +0200 Subject: [PATCH] Fix build on very old GCC. --- src/modules/keyboard/KeyboardLayoutModel.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/keyboard/KeyboardLayoutModel.cpp b/src/modules/keyboard/KeyboardLayoutModel.cpp index c1d5e057e..9f045043e 100644 --- a/src/modules/keyboard/KeyboardLayoutModel.cpp +++ b/src/modules/keyboard/KeyboardLayoutModel.cpp @@ -59,13 +59,16 @@ KeyboardLayoutModel::data( const QModelIndex& index, int role ) const void KeyboardLayoutModel::init() { - auto layouts = KeyboardGlobal::getKeyboardLayouts(); - for ( auto it = layouts.constBegin(); it != layouts.constEnd(); ++it ) + QMap< QString, KeyboardGlobal::KeyboardInfo > layouts = + KeyboardGlobal::getKeyboardLayouts(); + for ( QMap< QString, KeyboardGlobal::KeyboardInfo >::const_iterator it = layouts.constBegin(); + it != layouts.constEnd(); ++it ) { m_layouts.append( qMakePair( it.key(), it.value() ) ); } - std::stable_sort( m_layouts.begin(), m_layouts.end(), []( auto a, auto b ) + std::stable_sort( m_layouts.begin(), m_layouts.end(), []( const QPair< QString, KeyboardGlobal::KeyboardInfo >& a, + const QPair< QString, KeyboardGlobal::KeyboardInfo >& b ) { return a.second.description < b.second.description; } );