From df7214fdb596ad4854c52d7f85e57643997a9d0e Mon Sep 17 00:00:00 2001 From: in1tiate Date: Tue, 19 Jul 2022 08:10:07 -0500 Subject: [PATCH] Make lambda captures of 'this' explicit --- src/aobutton.cpp | 2 +- src/aoimage.cpp | 2 +- src/aooptionsdialog.cpp | 10 +++++----- src/courtroom.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/aobutton.cpp b/src/aobutton.cpp index 242fe79..6d25a05 100644 --- a/src/aobutton.cpp +++ b/src/aobutton.cpp @@ -8,7 +8,7 @@ AOButton::AOButton(QWidget *parent, AOApplication *p_ao_app) { ao_app = p_ao_app; movie = new QMovie(this); - connect(movie, &QMovie::frameChanged, [=]{ + connect(movie, &QMovie::frameChanged, [this]{ this->setIcon(movie->currentPixmap().scaled(this->size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); this->setIconSize(QSize(this->width(), this->height())); }); diff --git a/src/aoimage.cpp b/src/aoimage.cpp index df69e46..c488a09 100644 --- a/src/aoimage.cpp +++ b/src/aoimage.cpp @@ -12,7 +12,7 @@ AOImage::AOImage(QWidget *parent, AOApplication *p_ao_app, bool make_static) : Q if (!is_static) // Only create the QMovie if we're non-static { movie = new QMovie(this); - connect(movie, &QMovie::frameChanged, [=]{ + connect(movie, &QMovie::frameChanged, [this]{ QPixmap f_pixmap = movie->currentPixmap(); f_pixmap = f_pixmap.scaled(this->size(), Qt::IgnoreAspectRatio); diff --git a/src/aooptionsdialog.cpp b/src/aooptionsdialog.cpp index 759d49d..1d1a5eb 100644 --- a/src/aooptionsdialog.cpp +++ b/src/aooptionsdialog.cpp @@ -854,7 +854,7 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) ui_mount_remove->setSizePolicy(stretch_btns); ui_mount_remove->setEnabled(false); ui_mount_buttons_layout->addWidget(ui_mount_remove, 0, 1, 1, 1); - connect(ui_mount_remove, &QPushButton::clicked, this, [=] { + connect(ui_mount_remove, &QPushButton::clicked, this, [this] { auto selected = ui_mount_list->selectedItems(); if (selected.isEmpty()) return; @@ -872,7 +872,7 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) ui_mount_up->setMaximumWidth(40); ui_mount_up->setEnabled(false); ui_mount_buttons_layout->addWidget(ui_mount_up, 0, 3, 1, 1); - connect(ui_mount_up, &QPushButton::clicked, this, [=] { + connect(ui_mount_up, &QPushButton::clicked, this, [this] { auto selected = ui_mount_list->selectedItems(); if (selected.isEmpty()) return; @@ -890,7 +890,7 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) ui_mount_down->setMaximumWidth(40); ui_mount_down->setEnabled(false); ui_mount_buttons_layout->addWidget(ui_mount_down, 0, 4, 1, 1); - connect(ui_mount_down, &QPushButton::clicked, this, [=] { + connect(ui_mount_down, &QPushButton::clicked, this, [this] { auto selected = ui_mount_list->selectedItems(); if (selected.isEmpty()) return; @@ -912,12 +912,12 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) "Use this when you have added an asset that takes precedence over another " "existing asset.")); ui_mount_buttons_layout->addWidget(ui_mount_clear_cache, 0, 6, 1, 1); - connect(ui_mount_clear_cache, &QPushButton::clicked, this, [=] { + connect(ui_mount_clear_cache, &QPushButton::clicked, this, [this] { asset_cache_dirty = true; ui_mount_clear_cache->setEnabled(false); }); - connect(ui_mount_list, &QListWidget::itemSelectionChanged, this, [=] { + connect(ui_mount_list, &QListWidget::itemSelectionChanged, this, [this] { auto selected_items = ui_mount_list->selectedItems(); bool row_selected = !ui_mount_list->selectedItems().isEmpty(); ui_mount_remove->setEnabled(row_selected); diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 30d226e..4581c2a 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -1807,7 +1807,7 @@ void Courtroom::on_chat_return_pressed() ui_ic_chat_message->blockSignals(true); QTimer::singleShot(ao_app->get_chat_ratelimit(), this, - [=] { ui_ic_chat_message->blockSignals(false); }); + [this] { ui_ic_chat_message->blockSignals(false); }); // MS# // deskmod# // pre-emote#