mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
remove unneeded "setCurrentIndex(-1)", when reading audio in/out device lists
The combo boxes current index is set to the correct value at end of initialization loop.
This commit is contained in:
parent
9b5c799742
commit
719def932b
@ -282,7 +282,6 @@ void AVForm::getAudioInDevices()
|
|||||||
const char* pDeviceList = Audio::inDeviceNames();
|
const char* pDeviceList = Audio::inDeviceNames();
|
||||||
if (pDeviceList)
|
if (pDeviceList)
|
||||||
{
|
{
|
||||||
//prevent currentIndexChanged to be fired while adding items
|
|
||||||
while (*pDeviceList)
|
while (*pDeviceList)
|
||||||
{
|
{
|
||||||
int len = strlen(pDeviceList);
|
int len = strlen(pDeviceList);
|
||||||
@ -292,8 +291,6 @@ void AVForm::getAudioInDevices()
|
|||||||
inDevIndex = bodyUI->inDevCombobox->count()-1;
|
inDevIndex = bodyUI->inDevCombobox->count()-1;
|
||||||
pDeviceList += len+1;
|
pDeviceList += len+1;
|
||||||
}
|
}
|
||||||
//addItem changes currentIndex -> reset
|
|
||||||
bodyUI->inDevCombobox->setCurrentIndex(-1);
|
|
||||||
}
|
}
|
||||||
bodyUI->inDevCombobox->blockSignals(false);
|
bodyUI->inDevCombobox->blockSignals(false);
|
||||||
bodyUI->inDevCombobox->setCurrentIndex(inDevIndex);
|
bodyUI->inDevCombobox->setCurrentIndex(inDevIndex);
|
||||||
@ -309,7 +306,6 @@ void AVForm::getAudioOutDevices()
|
|||||||
const char* pDeviceList = Audio::outDeviceNames();
|
const char* pDeviceList = Audio::outDeviceNames();
|
||||||
if (pDeviceList)
|
if (pDeviceList)
|
||||||
{
|
{
|
||||||
//prevent currentIndexChanged to be fired while adding items
|
|
||||||
while (*pDeviceList)
|
while (*pDeviceList)
|
||||||
{
|
{
|
||||||
int len = strlen(pDeviceList);
|
int len = strlen(pDeviceList);
|
||||||
@ -321,8 +317,6 @@ void AVForm::getAudioOutDevices()
|
|||||||
}
|
}
|
||||||
pDeviceList += len+1;
|
pDeviceList += len+1;
|
||||||
}
|
}
|
||||||
//addItem changes currentIndex -> reset
|
|
||||||
bodyUI->outDevCombobox->setCurrentIndex(-1);
|
|
||||||
}
|
}
|
||||||
bodyUI->outDevCombobox->blockSignals(false);
|
bodyUI->outDevCombobox->blockSignals(false);
|
||||||
bodyUI->outDevCombobox->setCurrentIndex(outDevIndex);
|
bodyUI->outDevCombobox->setCurrentIndex(outDevIndex);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user