DolphinQt: Remove unnecessary qOverloads

qOverload is used to disambiguate pointers to overloaded functions, but
most of the usages in the code base were with non-overloaded functions.
This commit is contained in:
Dentomologist
2023-11-04 14:01:39 -07:00
parent b7b8f46832
commit 43e69d3e6a
33 changed files with 101 additions and 141 deletions

View File

@ -190,12 +190,11 @@ void AdvancedPane::CreateLayout()
void AdvancedPane::ConnectLayout()
{
connect(m_cpu_emulation_engine_combobox, qOverload<int>(&QComboBox::currentIndexChanged),
[](int index) {
const auto cpu_cores = PowerPC::AvailableCPUCores();
if (index >= 0 && static_cast<size_t>(index) < cpu_cores.size())
Config::SetBaseOrCurrent(Config::MAIN_CPU_CORE, cpu_cores[index]);
});
connect(m_cpu_emulation_engine_combobox, &QComboBox::currentIndexChanged, [](int index) {
const auto cpu_cores = PowerPC::AvailableCPUCores();
if (index >= 0 && static_cast<size_t>(index) < cpu_cores.size())
Config::SetBaseOrCurrent(Config::MAIN_CPU_CORE, cpu_cores[index]);
});
connect(m_cpu_clock_override_checkbox, &QCheckBox::toggled, [this](bool enable_clock_override) {
Config::SetBaseOrCurrent(Config::MAIN_OVERCLOCK_ENABLE, enable_clock_override);

View File

@ -174,13 +174,11 @@ void AudioPane::CreateWidgets()
void AudioPane::ConnectWidgets()
{
connect(m_backend_combo, qOverload<int>(&QComboBox::currentIndexChanged), this,
&AudioPane::SaveSettings);
connect(m_backend_combo, &QComboBox::currentIndexChanged, this, &AudioPane::SaveSettings);
connect(m_volume_slider, &QSlider::valueChanged, this, &AudioPane::SaveSettings);
if (m_latency_control_supported)
{
connect(m_latency_spin, qOverload<int>(&QSpinBox::valueChanged), this,
&AudioPane::SaveSettings);
connect(m_latency_spin, &QSpinBox::valueChanged, this, &AudioPane::SaveSettings);
}
connect(m_stretching_buffer_slider, &QSlider::valueChanged, this, &AudioPane::SaveSettings);
connect(m_dolby_pro_logic, &QCheckBox::toggled, this, &AudioPane::SaveSettings);
@ -191,8 +189,7 @@ void AudioPane::ConnectWidgets()
connect(m_dsp_interpreter, &QRadioButton::toggled, this, &AudioPane::SaveSettings);
#ifdef _WIN32
connect(m_wasapi_device_combo, qOverload<int>(&QComboBox::currentIndexChanged), this,
&AudioPane::SaveSettings);
connect(m_wasapi_device_combo, &QComboBox::currentIndexChanged, this, &AudioPane::SaveSettings);
#endif
}

View File

@ -249,15 +249,14 @@ void GameCubePane::ConnectWidgets()
{
// IPL Settings
connect(m_skip_main_menu, &QCheckBox::stateChanged, this, &GameCubePane::SaveSettings);
connect(m_language_combo, qOverload<int>(&QComboBox::currentIndexChanged), this,
&GameCubePane::SaveSettings);
connect(m_language_combo, &QComboBox::currentIndexChanged, this, &GameCubePane::SaveSettings);
// Device Settings
for (ExpansionInterface::Slot slot : ExpansionInterface::SLOTS)
{
connect(m_slot_combos[slot], qOverload<int>(&QComboBox::currentIndexChanged), this,
connect(m_slot_combos[slot], &QComboBox::currentIndexChanged, this,
[this, slot] { UpdateButton(slot); });
connect(m_slot_combos[slot], qOverload<int>(&QComboBox::currentIndexChanged), this,
connect(m_slot_combos[slot], &QComboBox::currentIndexChanged, this,
&GameCubePane::SaveSettings);
connect(m_slot_buttons[slot], &QPushButton::clicked, [this, slot] { OnConfigPressed(slot); });
}

View File

@ -105,20 +105,20 @@ void GeneralPane::ConnectLayout()
if (AutoUpdateChecker::SystemSupportsAutoUpdates())
{
connect(m_combobox_update_track, qOverload<int>(&QComboBox::currentIndexChanged), this,
connect(m_combobox_update_track, &QComboBox::currentIndexChanged, this,
&GeneralPane::OnSaveConfig);
connect(&Settings::Instance(), &Settings::AutoUpdateTrackChanged, this,
&GeneralPane::LoadConfig);
}
// Advanced
connect(m_combobox_speedlimit, qOverload<int>(&QComboBox::currentIndexChanged), [this]() {
connect(m_combobox_speedlimit, &QComboBox::currentIndexChanged, [this]() {
Config::SetBaseOrCurrent(Config::MAIN_EMULATION_SPEED,
m_combobox_speedlimit->currentIndex() * 0.1f);
Config::Save();
});
connect(m_combobox_fallback_region, qOverload<int>(&QComboBox::currentIndexChanged), this,
connect(m_combobox_fallback_region, &QComboBox::currentIndexChanged, this,
&GeneralPane::OnSaveConfig);
connect(&Settings::Instance(), &Settings::FallbackRegionChanged, this, &GeneralPane::LoadConfig);

View File

@ -217,13 +217,12 @@ void InterfacePane::ConnectLayout()
connect(m_checkbox_disable_screensaver, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_show_debugging_ui, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_focused_hotkeys, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(
m_combobox_theme, qOverload<int>(&QComboBox::currentIndexChanged), this,
[this](int index) { Settings::Instance().SetThemeName(m_combobox_theme->itemText(index)); });
connect(m_combobox_userstyle, qOverload<int>(&QComboBox::currentIndexChanged), this,
&InterfacePane::OnSaveConfig);
connect(m_combobox_language, qOverload<int>(&QComboBox::currentIndexChanged), this,
connect(m_combobox_theme, &QComboBox::currentIndexChanged, this, [this](int index) {
Settings::Instance().SetThemeName(m_combobox_theme->itemText(index));
});
connect(m_combobox_userstyle, &QComboBox::currentIndexChanged, this,
&InterfacePane::OnSaveConfig);
connect(m_combobox_language, &QComboBox::currentIndexChanged, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_top_window, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_confirm_on_stop, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_use_panic_handlers, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);

View File

@ -109,12 +109,9 @@ void WiiPane::CreateLayout()
void WiiPane::ConnectLayout()
{
// Misc Settings
connect(m_aspect_ratio_choice, qOverload<int>(&QComboBox::currentIndexChanged), this,
&WiiPane::OnSaveConfig);
connect(m_system_language_choice, qOverload<int>(&QComboBox::currentIndexChanged), this,
&WiiPane::OnSaveConfig);
connect(m_sound_mode_choice, qOverload<int>(&QComboBox::currentIndexChanged), this,
&WiiPane::OnSaveConfig);
connect(m_aspect_ratio_choice, &QComboBox::currentIndexChanged, this, &WiiPane::OnSaveConfig);
connect(m_system_language_choice, &QComboBox::currentIndexChanged, this, &WiiPane::OnSaveConfig);
connect(m_sound_mode_choice, &QComboBox::currentIndexChanged, this, &WiiPane::OnSaveConfig);
connect(m_screensaver_checkbox, &QCheckBox::toggled, this, &WiiPane::OnSaveConfig);
connect(m_pal60_mode_checkbox, &QCheckBox::toggled, this, &WiiPane::OnSaveConfig);
connect(m_connect_keyboard_checkbox, &QCheckBox::toggled, this, &WiiPane::OnSaveConfig);
@ -128,8 +125,7 @@ void WiiPane::ConnectLayout()
connect(m_sd_card_checkbox, &QCheckBox::toggled, this, &WiiPane::OnSaveConfig);
connect(m_allow_sd_writes_checkbox, &QCheckBox::toggled, this, &WiiPane::OnSaveConfig);
connect(m_sync_sd_folder_checkbox, &QCheckBox::toggled, this, &WiiPane::OnSaveConfig);
connect(m_sd_card_size_combo, qOverload<int>(&QComboBox::currentIndexChanged), this,
&WiiPane::OnSaveConfig);
connect(m_sd_card_size_combo, &QComboBox::currentIndexChanged, this, &WiiPane::OnSaveConfig);
// Whitelisted USB Passthrough Devices
connect(m_whitelist_usb_list, &QListWidget::itemClicked, this, &WiiPane::ValidateSelectionState);
@ -139,7 +135,7 @@ void WiiPane::ConnectLayout()
&WiiPane::OnUSBWhitelistRemoveButton);
// Wii Remote Settings
connect(m_wiimote_ir_sensor_position, qOverload<int>(&QComboBox::currentIndexChanged), this,
connect(m_wiimote_ir_sensor_position, &QComboBox::currentIndexChanged, this,
&WiiPane::OnSaveConfig);
connect(m_wiimote_ir_sensitivity, &QSlider::valueChanged, this, &WiiPane::OnSaveConfig);
connect(m_wiimote_speaker_volume, &QSlider::valueChanged, this, &WiiPane::OnSaveConfig);