From 2946ad43c463c57047a18a89989c6e6e7ad7c96d Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sun, 11 Aug 2013 02:35:44 +0000 Subject: [PATCH] Bugfix: DevSetup was not filling the sound output combo box correctly, causing the current setting to be changed without user input. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3544 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- devsetup.cpp | 10 +++++----- devsetup.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/devsetup.cpp b/devsetup.cpp index b0ed3ea48..6036c0cec 100644 --- a/devsetup.cpp +++ b/devsetup.cpp @@ -49,8 +49,8 @@ void DevSetup::initDlg() // // load combo boxes with audio setup choices // - loadAudioDevices (m_audioInputDevices, ui->comboBoxSndIn); - loadAudioDevices (m_audioOutputDevices, ui->comboBoxSndOut); + loadAudioDevices (m_audioInputDevices, ui->comboBoxSndIn, m_audioInputDevice, QAudioDeviceInfo::defaultInputDevice ()); + loadAudioDevices (m_audioOutputDevices, ui->comboBoxSndOut, m_audioOutputDevice, QAudioDeviceInfo::defaultOutputDevice ()); { using namespace std::tr1; @@ -621,7 +621,7 @@ void DevSetup::on_cbXIT_toggled(bool checked) if(m_bSplit and m_bXIT) ui->cbSplit->setChecked(false); } -void DevSetup::loadAudioDevices (AudioDevices const& d, QComboBox * cb) +void DevSetup::loadAudioDevices (AudioDevices const& d, QComboBox * cb, QAudioDeviceInfo const& device, QAudioDeviceInfo const& defaultDevice) { using std::copy; using std::back_inserter; @@ -636,11 +636,11 @@ void DevSetup::loadAudioDevices (AudioDevices const& d, QComboBox * cb) copy (scc.cbegin (), scc.cend (), back_inserter (channelCounts)); cb->addItem (p->deviceName (), channelCounts); - if (*p == m_audioInputDevice) + if (*p == device) { currentIndex = p - d.cbegin (); } - else if (*p == QAudioDeviceInfo::defaultInputDevice ()) + else if (*p == defaultDevice) { defaultIndex = p - d.cbegin (); } diff --git a/devsetup.h b/devsetup.h index 51fd2fba0..ca77695ca 100644 --- a/devsetup.h +++ b/devsetup.h @@ -114,7 +114,7 @@ private slots: void on_cbXIT_toggled(bool checked); private: - void loadAudioDevices (AudioDevices const&, QComboBox *); + void loadAudioDevices (AudioDevices const&, QComboBox *, QAudioDeviceInfo const&, QAudioDeviceInfo const&); void updateAudioChannels (QComboBox const *, int, QComboBox *, bool); void enumerateRigs (); Rig* rig;