mirror of
https://github.com/stenzek/duckstation.git
synced 2025-07-28 22:01:59 +00:00
Qt: Fix another usage of QObject::disconnect()
This commit is contained in:
parent
a5826ea6ae
commit
2e56f5d3ae
@ -154,10 +154,8 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsWindow* dialog, QWidget* pa
|
||||
&ConsoleSettingsWidget::onEnableCPUClockSpeedControlChecked);
|
||||
connect(m_ui.cpuClockSpeed, &QSlider::valueChanged, this, &ConsoleSettingsWidget::onCPUClockSpeedValueChanged);
|
||||
|
||||
SettingWidgetBinder::SetAvailability(m_ui.cpuExecutionModeLabel,
|
||||
!m_dialog->hasGameTrait(GameDatabase::Trait::ForceInterpreter));
|
||||
SettingWidgetBinder::SetAvailability(m_ui.cpuExecutionMode,
|
||||
!m_dialog->hasGameTrait(GameDatabase::Trait::ForceInterpreter));
|
||||
SettingWidgetBinder::SetAvailability(
|
||||
m_ui.cpuExecutionMode, !m_dialog->hasGameTrait(GameDatabase::Trait::ForceInterpreter), m_ui.cpuExecutionModeLabel);
|
||||
|
||||
calculateCPUClockValue();
|
||||
}
|
||||
|
@ -1497,12 +1497,22 @@ static inline void BindWidgetToFolderSetting(SettingsInterface* sif, QLineEdit*
|
||||
}
|
||||
|
||||
template<typename WidgetType>
|
||||
static inline void SetAvailability(WidgetType* widget, bool available)
|
||||
static inline void DisconnectWidget(WidgetType* widget)
|
||||
{
|
||||
using Accessor = SettingAccessor<WidgetType>;
|
||||
Accessor::disconnect(widget);
|
||||
}
|
||||
|
||||
template<typename WidgetType>
|
||||
static inline void SetAvailability(WidgetType* widget, bool available, QLabel* widget_label = nullptr)
|
||||
{
|
||||
if (available)
|
||||
return;
|
||||
|
||||
widget->disconnect();
|
||||
if (widget_label)
|
||||
widget_label->setEnabled(false);
|
||||
|
||||
DisconnectWidget(widget);
|
||||
|
||||
if constexpr (std::is_same_v<WidgetType, QComboBox>)
|
||||
{
|
||||
@ -1530,11 +1540,4 @@ static inline void SetAvailability(WidgetType* widget, bool available)
|
||||
widget->setEnabled(false);
|
||||
}
|
||||
|
||||
template<typename WidgetType>
|
||||
static inline void DisconnectWidget(WidgetType* widget)
|
||||
{
|
||||
using Accessor = SettingAccessor<WidgetType>;
|
||||
Accessor::disconnect(widget);
|
||||
}
|
||||
|
||||
} // namespace SettingWidgetBinder
|
||||
|
Loading…
x
Reference in New Issue
Block a user