Keyboard: avoid multiple connects

When selecting keyboard layout, pause, then select another, the
QTimer wasn't being disconnected from the previously selected
language, so the second selection would fire the timeout, and
then call *two* slots .. and then three, ... Disconnect when
the timer fires, too.
This commit is contained in:
Adriaan de Groot 2017-06-05 14:50:27 -04:00
parent d29acf4a06
commit 3ae12f2573

View File

@ -323,6 +323,7 @@ KeyboardPage::onListVariantCurrentItemChanged( QListWidgetItem* current, QListWi
QProcess::execute( QString( "setxkbmap -layout \"%1\" -variant \"%2\"" )
.arg( layout, variant ).toUtf8() );
cDebug() << "xkbmap selection changed to: " << layout << "-" << variant;
m_setxkbmapTimer.disconnect( this );
} );
m_setxkbmapTimer.start( QApplication::keyboardInputInterval() );