kxkb: prevent overflow in case of non-existing layout group

Signed-off-by: Roman Savochenko <roman@oscada.org>
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit d4d334c1af)
pull/478/head
Roman Savochenko 1 year ago committed by Michele Calgaro
parent 1206271a07
commit 87b9269efb
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -274,7 +274,12 @@ void KXKBApp::menuActivated(int id)
// }
}
void KXKBApp::slotGroupChanged(uint group) {
void KXKBApp::slotGroupChanged(uint group)
{
if (group >= kxkbConfig.m_layouts.count())
{
group = 0;
}
m_currentLayout = kxkbConfig.m_layouts[group];
m_tray->setCurrentLayout(m_currentLayout);
}
@ -341,4 +346,4 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
app.disableSessionManagement();
app.exec();
return 0;
}
}

Loading…
Cancel
Save