Source: Remove redundant lambda parameter lists

This commit is contained in:
Dr. Dystopia
2025-04-28 22:02:56 +02:00
parent 95f6c76713
commit ca8f9b672b
54 changed files with 108 additions and 111 deletions

View File

@ -33,7 +33,7 @@ void ConfigInteger::OnConfigChanged()
ConfigIntegerLabel::ConfigIntegerLabel(const QString& text, ConfigInteger* widget)
: QLabel(text), m_widget(QPointer<ConfigInteger>(widget))
{
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this]() {
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
// Label shares font changes with ConfigInteger to mark game ini settings.
if (m_widget)
setFont(m_widget->font());

View File

@ -113,7 +113,7 @@ void ConfigSliderU32::OnConfigChanged()
ConfigSliderLabel::ConfigSliderLabel(const QString& text, ConfigSlider* slider)
: QLabel(text), m_slider(QPointer<ConfigSlider>(slider))
{
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this]() {
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
// Label shares font changes with slider to mark game ini settings.
if (m_slider)
setFont(m_slider->font());

View File

@ -88,7 +88,7 @@ GameConfigWidget::GameConfigWidget(const UICommon::GameFile& game) : m_game(game
}
// Fails to change font if it's directly called at this time. Is there a better workaround?
QTimer::singleShot(100, this, [this]() {
QTimer::singleShot(100, this, [this] {
SetItalics();
Config::OnConfigChanged();
});

View File

@ -41,10 +41,10 @@ EnhancementsWidget::EnhancementsWidget(GraphicsWindow* parent)
// BackendChanged is called by parent on window creation.
connect(parent, &GraphicsWindow::BackendChanged, this, &EnhancementsWidget::OnBackendChanged);
connect(parent, &GraphicsWindow::UseFastTextureSamplingChanged, this, [this]() {
connect(parent, &GraphicsWindow::UseFastTextureSamplingChanged, this, [this] {
m_texture_filtering_combo->setEnabled(ReadSetting(Config::GFX_HACK_FAST_TEXTURE_SAMPLING));
});
connect(parent, &GraphicsWindow::UseGPUTextureDecodingChanged, this, [this]() {
connect(parent, &GraphicsWindow::UseGPUTextureDecodingChanged, this, [this] {
m_arbitrary_mipmap_detection->setEnabled(!ReadSetting(Config::GFX_ENABLE_GPU_TEXTURE_DECODING));
});
}

View File

@ -113,7 +113,7 @@ QTextCharFormat GetCommentCharFormat()
ControlExpressionSyntaxHighlighter::ControlExpressionSyntaxHighlighter(QTextDocument* parent)
: QObject(parent)
{
connect(parent, &QTextDocument::contentsChanged, this, [this, parent]() { Highlight(parent); });
connect(parent, &QTextDocument::contentsChanged, this, [this, parent] { Highlight(parent); });
}
void QComboBoxWithMouseWheelDisabled::wheelEvent(QWheelEvent* event)

View File

@ -990,15 +990,15 @@ void CalibrationWidget::SetupActions()
const auto center_action = new QAction(tr("Center and Calibrate"), this);
const auto reset_action = new QAction(tr("Reset"), this);
connect(calibrate_action, &QAction::triggered, [this]() {
connect(calibrate_action, &QAction::triggered, [this] {
StartCalibration();
m_new_center = Common::DVec2{};
});
connect(center_action, &QAction::triggered, [this]() {
connect(center_action, &QAction::triggered, [this] {
StartCalibration();
m_new_center = std::nullopt;
});
connect(reset_action, &QAction::triggered, [this]() {
connect(reset_action, &QAction::triggered, [this] {
m_input.SetCalibrationToDefault();
m_input.SetCenter({0, 0});
});
@ -1012,7 +1012,7 @@ void CalibrationWidget::SetupActions()
setDefaultAction(calibrate_action);
m_completion_action = new QAction(tr("Finish Calibration"), this);
connect(m_completion_action, &QAction::triggered, [this]() {
connect(m_completion_action, &QAction::triggered, [this] {
m_input.SetCenter(GetCenter());
m_input.SetCalibrationData(std::move(m_calibration_data));
m_informative_timer->stop();
@ -1027,7 +1027,7 @@ void CalibrationWidget::StartCalibration()
// Cancel calibration.
const auto cancel_action = new QAction(tr("Cancel Calibration"), this);
connect(cancel_action, &QAction::triggered, [this]() {
connect(cancel_action, &QAction::triggered, [this] {
m_calibration_data.clear();
m_informative_timer->stop();
SetupActions();

View File

@ -343,7 +343,7 @@ void MappingWidget::CreateControl(const ControllerEmu::Control* control, QFormLa
if (m_previous_mapping_button)
{
connect(m_previous_mapping_button, &MappingButton::QueueNextButtonMapping,
[this, button]() { m_parent->QueueInputDetection(button); });
[this, button] { m_parent->QueueInputDetection(button); });
}
m_previous_mapping_button = button;
}
@ -383,7 +383,7 @@ MappingWidget::CreateSettingAdvancedMappingButton(ControllerEmu::NumericSettingB
const auto button = new QPushButton(tr("..."));
button->setFixedWidth(QFontMetrics(font()).boundingRect(button->text()).width() * 2);
button->connect(button, &QPushButton::clicked, [this, &setting]() {
button->connect(button, &QPushButton::clicked, [this, &setting] {
if (setting.IsSimpleValue())
setting.SetExpressionFromValue();