Merge pull request #819 from AttorneyOnline/lambda-core

Make lambda captures of 'this' explicit
This commit is contained in:
oldmud0 2022-07-23 16:31:37 -05:00 committed by GitHub
commit 0dac3cc2c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -8,7 +8,7 @@ AOButton::AOButton(QWidget *parent, AOApplication *p_ao_app)
{ {
ao_app = p_ao_app; ao_app = p_ao_app;
movie = new QMovie(this); 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->setIcon(movie->currentPixmap().scaled(this->size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
this->setIconSize(QSize(this->width(), this->height())); this->setIconSize(QSize(this->width(), this->height()));
}); });

View File

@ -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 if (!is_static) // Only create the QMovie if we're non-static
{ {
movie = new QMovie(this); movie = new QMovie(this);
connect(movie, &QMovie::frameChanged, [=]{ connect(movie, &QMovie::frameChanged, [this]{
QPixmap f_pixmap = movie->currentPixmap(); QPixmap f_pixmap = movie->currentPixmap();
f_pixmap = f_pixmap =
f_pixmap.scaled(this->size(), Qt::IgnoreAspectRatio); f_pixmap.scaled(this->size(), Qt::IgnoreAspectRatio);

View File

@ -869,7 +869,7 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
ui_mount_remove->setSizePolicy(stretch_btns); ui_mount_remove->setSizePolicy(stretch_btns);
ui_mount_remove->setEnabled(false); ui_mount_remove->setEnabled(false);
ui_mount_buttons_layout->addWidget(ui_mount_remove, 0, 1, 1, 1); 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(); auto selected = ui_mount_list->selectedItems();
if (selected.isEmpty()) if (selected.isEmpty())
return; return;
@ -887,7 +887,7 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
ui_mount_up->setMaximumWidth(40); ui_mount_up->setMaximumWidth(40);
ui_mount_up->setEnabled(false); ui_mount_up->setEnabled(false);
ui_mount_buttons_layout->addWidget(ui_mount_up, 0, 3, 1, 1); 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(); auto selected = ui_mount_list->selectedItems();
if (selected.isEmpty()) if (selected.isEmpty())
return; return;
@ -905,7 +905,7 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
ui_mount_down->setMaximumWidth(40); ui_mount_down->setMaximumWidth(40);
ui_mount_down->setEnabled(false); ui_mount_down->setEnabled(false);
ui_mount_buttons_layout->addWidget(ui_mount_down, 0, 4, 1, 1); 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(); auto selected = ui_mount_list->selectedItems();
if (selected.isEmpty()) if (selected.isEmpty())
return; return;
@ -927,12 +927,12 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
"Use this when you have added an asset that takes precedence over another " "Use this when you have added an asset that takes precedence over another "
"existing asset.")); "existing asset."));
ui_mount_buttons_layout->addWidget(ui_mount_clear_cache, 0, 6, 1, 1); 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; asset_cache_dirty = true;
ui_mount_clear_cache->setEnabled(false); 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(); auto selected_items = ui_mount_list->selectedItems();
bool row_selected = !ui_mount_list->selectedItems().isEmpty(); bool row_selected = !ui_mount_list->selectedItems().isEmpty();
ui_mount_remove->setEnabled(row_selected); ui_mount_remove->setEnabled(row_selected);

View File

@ -1829,7 +1829,7 @@ void Courtroom::on_chat_return_pressed()
ui_ic_chat_message->blockSignals(true); ui_ic_chat_message->blockSignals(true);
QTimer::singleShot(ao_app->get_chat_ratelimit(), this, QTimer::singleShot(ao_app->get_chat_ratelimit(), this,
[=] { ui_ic_chat_message->blockSignals(false); }); [this] { ui_ic_chat_message->blockSignals(false); });
// MS# // MS#
// deskmod# // deskmod#
// pre-emote# // pre-emote#