From a55b127366d2ba0f6015cf50d7fc6d763ec9f32d Mon Sep 17 00:00:00 2001 From: Kung-vr Date: Sat, 12 Jan 2019 00:33:55 +0900 Subject: [PATCH] Fixed audio devices swapping on device hw changes When audio devices connected or disconnected from the system, the default audio device swapped around. This was because of QML setting index 0 on ComboBox.model changes. onCurrentIndexChanged was calling setPlaybackDeviceIndex() / mirrorDevice/ micDevice etc... in the audio tab controller and actively setting the audio device index to 0 momentarily. Changing onCurrentIndexChanged to onActivated allows the ComboBox to only actively command the audio tab controller in direct response to user interaction. --- src/res/qml/AudioPage.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/res/qml/AudioPage.qml b/src/res/qml/AudioPage.qml index 1d542ce..68b52b8 100644 --- a/src/res/qml/AudioPage.qml +++ b/src/res/qml/AudioPage.qml @@ -160,7 +160,7 @@ MyStackViewPage { Layout.maximumWidth: 850 Layout.minimumWidth: 850 Layout.preferredWidth: 850 - onCurrentIndexChanged: { + onActivated: { if (componentCompleted) { AudioTabController.setPlaybackDeviceIndex(currentIndex) } @@ -180,7 +180,7 @@ MyStackViewPage { Layout.maximumWidth: 850 Layout.minimumWidth: 850 Layout.preferredWidth: 850 - onCurrentIndexChanged: { + onActivated: { if (componentCompleted) { AudioTabController.setMirrorDeviceIndex(currentIndex - 1) } @@ -263,7 +263,7 @@ MyStackViewPage { Layout.maximumWidth: 850 Layout.minimumWidth: 850 Layout.preferredWidth: 850 - onCurrentIndexChanged: { + onActivated: { if (componentCompleted) { AudioTabController.setMicDeviceIndex(currentIndex) }