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:
parent
f5f7b5abba
commit
15181c431a
|
@ -456,11 +456,11 @@ void AVForm::getAudioInDevices()
|
||||||
inDevCombobox->blockSignals(false);
|
inDevCombobox->blockSignals(false);
|
||||||
|
|
||||||
int idx = 0;
|
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;
|
QString dev = Settings::getInstance().getInDev();
|
||||||
if (idx <= 0)
|
idx = qMax(deviceNames.indexOf(dev), 1);
|
||||||
idx = 1;
|
|
||||||
}
|
}
|
||||||
inDevCombobox->setCurrentIndex(idx);
|
inDevCombobox->setCurrentIndex(idx);
|
||||||
}
|
}
|
||||||
|
@ -476,11 +476,11 @@ void AVForm::getAudioOutDevices()
|
||||||
outDevCombobox->blockSignals(false);
|
outDevCombobox->blockSignals(false);
|
||||||
|
|
||||||
int idx = 0;
|
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;
|
QString dev = Settings::getInstance().getOutDev();
|
||||||
if (idx <= 0)
|
idx = qMax(deviceNames.indexOf(dev), 1);
|
||||||
idx = 1;
|
|
||||||
}
|
}
|
||||||
outDevCombobox->setCurrentIndex(idx);
|
outDevCombobox->setCurrentIndex(idx);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user