1
0
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:
Nils Fenner 2016-01-16 22:27:14 +01:00 committed by tux3
parent 9b5c799742
commit 719def932b
No known key found for this signature in database
GPG Key ID: 7E086DD661263264

View File

@ -282,7 +282,6 @@ void AVForm::getAudioInDevices()
const char* pDeviceList = Audio::inDeviceNames();
if (pDeviceList)
{
//prevent currentIndexChanged to be fired while adding items
while (*pDeviceList)
{
int len = strlen(pDeviceList);
@ -292,8 +291,6 @@ void AVForm::getAudioInDevices()
inDevIndex = bodyUI->inDevCombobox->count()-1;
pDeviceList += len+1;
}
//addItem changes currentIndex -> reset
bodyUI->inDevCombobox->setCurrentIndex(-1);
}
bodyUI->inDevCombobox->blockSignals(false);
bodyUI->inDevCombobox->setCurrentIndex(inDevIndex);
@ -309,7 +306,6 @@ void AVForm::getAudioOutDevices()
const char* pDeviceList = Audio::outDeviceNames();
if (pDeviceList)
{
//prevent currentIndexChanged to be fired while adding items
while (*pDeviceList)
{
int len = strlen(pDeviceList);
@ -321,8 +317,6 @@ void AVForm::getAudioOutDevices()
}
pDeviceList += len+1;
}
//addItem changes currentIndex -> reset
bodyUI->outDevCombobox->setCurrentIndex(-1);
}
bodyUI->outDevCombobox->blockSignals(false);
bodyUI->outDevCombobox->setCurrentIndex(outDevIndex);