Skip to content

Commit

Permalink
trivial: avoid relying on implicit capture of this when using =
Browse files Browse the repository at this point in the history
  • Loading branch information
kwvg committed Apr 19, 2024
1 parent 3c1969a commit 4d7f386
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions src/qt/appearancewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ AppearanceWidget::AppearanceWidget(QWidget* parent) :
connect(ui->fontWeightNormalSlider, &QSlider::valueChanged, [this](auto nValue) { updateFontWeightNormal(nValue); });
connect(ui->fontWeightBoldSlider, &QSlider::valueChanged, [this](auto nValue) { updateFontWeightBold(nValue); });

connect(ui->theme, &QComboBox::currentTextChanged, [=]() { Q_EMIT appearanceChanged(); });
connect(ui->fontFamily, &QComboBox::currentTextChanged, [=]() { Q_EMIT appearanceChanged(); });
connect(ui->fontScaleSlider, &QSlider::sliderReleased, [=]() { Q_EMIT appearanceChanged(); });
connect(ui->fontWeightNormalSlider, &QSlider::sliderReleased, [=]() { Q_EMIT appearanceChanged(); });
connect(ui->fontWeightBoldSlider, &QSlider::sliderReleased, [=]() { Q_EMIT appearanceChanged(); });
connect(ui->theme, &QComboBox::currentTextChanged, [this]() { Q_EMIT appearanceChanged(); });
connect(ui->fontFamily, &QComboBox::currentTextChanged, [this]() { Q_EMIT appearanceChanged(); });
connect(ui->fontScaleSlider, &QSlider::sliderReleased, [this]() { Q_EMIT appearanceChanged(); });
connect(ui->fontWeightNormalSlider, &QSlider::sliderReleased, [this]() { Q_EMIT appearanceChanged(); });
connect(ui->fontWeightBoldSlider, &QSlider::sliderReleased, [this]() { Q_EMIT appearanceChanged(); });
}

AppearanceWidget::~AppearanceWidget()
Expand Down
8 changes: 4 additions & 4 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const NetworkStyle* networkStyle,
bool fDebugCustomStyleSheets = gArgs.GetBoolArg("-debug-ui", false) && GUIUtil::isStyleSheetDirectoryCustom();
if (fDebugCustomStyleSheets) {
timerCustomCss = new QTimer(this);
QObject::connect(timerCustomCss, &QTimer::timeout, [=]() {
QObject::connect(timerCustomCss, &QTimer::timeout, [this]() {
if (!m_node.shutdownRequested()) {
GUIUtil::loadStyleSheet();
}
Expand Down Expand Up @@ -285,7 +285,7 @@ void BitcoinGUI::startSpinner()
};

timerSpinner = new QTimer(this);
QObject::connect(timerSpinner, &QTimer::timeout, [=]() {
QObject::connect(timerSpinner, &QTimer::timeout, [this, &getNextFrame]() {
if (timerSpinner == nullptr) {
return;
}
Expand Down Expand Up @@ -313,7 +313,7 @@ void BitcoinGUI::startConnectingAnimation()
}

timerConnecting = new QTimer(this);
QObject::connect(timerConnecting, &QTimer::timeout, [=]() {
QObject::connect(timerConnecting, &QTimer::timeout, [this]() {

if (timerConnecting == nullptr) {
return;
Expand Down Expand Up @@ -1311,7 +1311,7 @@ void BitcoinGUI::openOptionsDialogWithTab(OptionsDialog::Tab tab)
OptionsDialog dlg(this, enableWallet);
dlg.setCurrentTab(tab);
dlg.setModel(clientModel->getOptionsModel());
connect(&dlg, &OptionsDialog::appearanceChanged, [=]() {
connect(&dlg, &OptionsDialog::appearanceChanged, [this]() {
updateWidth();
});
dlg.exec();
Expand Down
6 changes: 3 additions & 3 deletions src/qt/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
appearanceLayout->addWidget(appearance);
ui->widgetAppearance->setLayout(appearanceLayout);

connect(appearance, &AppearanceWidget::appearanceChanged, [=](){
connect(appearance, &AppearanceWidget::appearanceChanged, [this](){
updateWidth();
Q_EMIT appearanceChanged();
});
Expand Down Expand Up @@ -274,7 +274,7 @@ void OptionsDialog::setModel(OptionsModel *_model)
connect(ui->lang, static_cast<void (QValueComboBox::*)()>(&QValueComboBox::valueChanged), [this]{ showRestartWarning(); });
connect(ui->thirdPartyTxUrls, &QLineEdit::textChanged, [this]{ showRestartWarning(); });

connect(ui->coinJoinEnabled, &QCheckBox::clicked, [=](bool fChecked) {
connect(ui->coinJoinEnabled, &QCheckBox::clicked, [this, &_model](bool fChecked) {
#ifdef ENABLE_WALLET
model->node().coinJoinOptions().setEnabled(fChecked);
#endif
Expand All @@ -290,7 +290,7 @@ void OptionsDialog::setModel(OptionsModel *_model)
// Store the current CoinJoin enabled state to recover it if it gets changed but the dialog gets not accepted but declined.
#ifdef ENABLE_WALLET
fCoinJoinEnabledPrev = model->node().coinJoinOptions().isEnabled();
connect(this, &OptionsDialog::rejected, [=]() {
connect(this, &OptionsDialog::rejected, [this]() {
if (fCoinJoinEnabledPrev != model->node().coinJoinOptions().isEnabled()) {
ui->coinJoinEnabled->click();
}
Expand Down
2 changes: 1 addition & 1 deletion src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ void OverviewPage::setWalletModel(WalletModel *model)
connect(model->getOptionsModel(), &OptionsModel::coinJoinRoundsChanged, this, &OverviewPage::updateCoinJoinProgress);
connect(model->getOptionsModel(), &OptionsModel::coinJoinAmountChanged, this, &OverviewPage::updateCoinJoinProgress);
connect(model->getOptionsModel(), &OptionsModel::AdvancedCJUIChanged, this, &OverviewPage::updateAdvancedCJUI);
connect(model->getOptionsModel(), &OptionsModel::coinJoinEnabledChanged, [=]() {
connect(model->getOptionsModel(), &OptionsModel::coinJoinEnabledChanged, [this]() {
coinJoinStatus(true);
});

Expand Down
2 changes: 1 addition & 1 deletion src/scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static void Repeat(CScheduler& s, CScheduler::Function f, std::chrono::milliseco

void CScheduler::scheduleEvery(CScheduler::Function f, std::chrono::milliseconds delta)
{
scheduleFromNow([=] { Repeat(*this, f, delta); }, delta);
scheduleFromNow([this, f, delta] { Repeat(*this, f, delta); }, delta);
}

size_t CScheduler::getQueueInfo(std::chrono::system_clock::time_point& first,
Expand Down

0 comments on commit 4d7f386

Please sign in to comment.