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.
main
Adriaan de Groot 8 years ago
parent d29acf4a06
commit 3ae12f2573

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

Loading…
Cancel
Save