1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-21 18:22:33 +01:00

Qt/Input: Properly clear pad selection in pad settings

Fixes a rare issue that causes a newly selected pad handler with no pads to try to connect a previously selected pad from another handler.
This commit is contained in:
Megamouse 2022-10-21 22:58:39 +02:00
parent 871ef2cdfe
commit cb8a240f1a

View File

@ -1443,7 +1443,7 @@ void pad_settings_dialog::ChangeHandler()
ui->chooseDevice->blockSignals(false);
// Handle empty device list
bool config_enabled = force_enable || (m_handler->m_type != pad_handler::null && ui->chooseDevice->count() > 0);
const bool config_enabled = force_enable || (m_handler->m_type != pad_handler::null && ui->chooseDevice->count() > 0);
if (config_enabled)
{
@ -1454,9 +1454,15 @@ void pad_settings_dialog::ChangeHandler()
if (pad_device_info info = get_pad_info(ui->chooseDevice, i); info.name == device)
{
ui->chooseDevice->setCurrentIndex(i);
break;
}
}
if (ui->chooseDevice->currentIndex() < 0 && ui->chooseDevice->count() > 0)
{
ui->chooseDevice->setCurrentIndex(0);
}
// Force Refresh
ChangeDevice(ui->chooseDevice->currentIndex());
}
@ -1466,6 +1472,8 @@ void pad_settings_dialog::ChangeHandler()
{
ui->chooseDevice->setPlaceholderText(tr("No Device Detected"));
}
m_device_name.clear();
}
// Handle running timers