1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(avform): Fixed empty value in audio and video lists

This commit is contained in:
Diadlo 2016-10-06 21:50:57 +03:00
parent f5f7b5abba
commit 15181c431a
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727

View File

@ -456,11 +456,11 @@ void AVForm::getAudioInDevices()
inDevCombobox->blockSignals(false);
int idx = 0;
if (Settings::getInstance().getAudioInDevEnabled() && deviceNames.size() > 1)
bool enabled = Settings::getInstance().getAudioInDevEnabled();
if (enabled && deviceNames.size() > 1)
{
idx = deviceNames.indexOf(Settings::getInstance().getInDev()) + 1;
if (idx <= 0)
idx = 1;
QString dev = Settings::getInstance().getInDev();
idx = qMax(deviceNames.indexOf(dev), 1);
}
inDevCombobox->setCurrentIndex(idx);
}
@ -476,11 +476,11 @@ void AVForm::getAudioOutDevices()
outDevCombobox->blockSignals(false);
int idx = 0;
if (Settings::getInstance().getAudioOutDevEnabled() && deviceNames.size() > 1)
bool enabled = Settings::getInstance().getAudioOutDevEnabled();
if (enabled && deviceNames.size() > 1)
{
idx = deviceNames.indexOf(Settings::getInstance().getOutDev()) + 1;
if (idx <= 0)
idx = 1;
QString dev = Settings::getInstance().getOutDev();
idx = qMax(deviceNames.indexOf(dev), 1);
}
outDevCombobox->setCurrentIndex(idx);
}