From 3ae12f2573c4ff26a34e6a9959f8465c7c6a01a0 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 5 Jun 2017 14:50:27 -0400 Subject: [PATCH] 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. --- src/modules/keyboard/KeyboardPage.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/keyboard/KeyboardPage.cpp b/src/modules/keyboard/KeyboardPage.cpp index 9dafae8b7..117530a88 100644 --- a/src/modules/keyboard/KeyboardPage.cpp +++ b/src/modules/keyboard/KeyboardPage.cpp @@ -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() );