From 560345cf4fc39ff811a6e6858b9b6986890b0dc2 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Sun, 20 Oct 2024 23:31:33 -0400 Subject: [PATCH] refactor: add context object for lambdas --- src/gui/src/MainWindow.cpp | 6 +++--- src/lib/gui/core/CoreProcess.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index d1c83ec9c..95c810044 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -198,7 +198,7 @@ void MainWindow::connectSlots() connect(&m_CoreProcess, &CoreProcess::error, this, &MainWindow::onCoreProcessError); connect( - &m_CoreProcess, &CoreProcess::logLine, // + &m_CoreProcess, &CoreProcess::logLine, this, // [this](const QString &line) { handleLogLine(line); } ); @@ -211,7 +211,7 @@ void MainWindow::connectSlots() connect(ui->m_pActionMinimize, &QAction::triggered, this, &MainWindow::hide); connect( - ui->m_pActionRestore, &QAction::triggered, // + ui->m_pActionRestore, &QAction::triggered, this, // [this]() { showAndActivate(); } ); @@ -269,7 +269,7 @@ void MainWindow::onShown() // this we delay the error dialog raise by a split second. this seems a bit // hacky and fragile, so maybe there's a better approach. const auto kCriticalDialogDelay = 100; - QTimer::singleShot(kCriticalDialogDelay, [] { messages::raiseCriticalDialog(); }); + QTimer::singleShot(kCriticalDialogDelay, this, [] { messages::raiseCriticalDialog(); }); } void MainWindow::onConfigScopesSaving() diff --git a/src/lib/gui/core/CoreProcess.cpp b/src/lib/gui/core/CoreProcess.cpp index afdd3e5d4..cf5050d0d 100644 --- a/src/lib/gui/core/CoreProcess.cpp +++ b/src/lib/gui/core/CoreProcess.cpp @@ -188,7 +188,7 @@ CoreProcess::CoreProcess(const IAppConfig &appConfig, const IServerConfig &serve &m_pDeps->process(), &QProcessProxy::readyReadStandardError, this, &CoreProcess::onProcessReadyReadStandardError ); - connect(&m_retryTimer, &QTimer::timeout, [this] { + connect(&m_retryTimer, &QTimer::timeout, this, [this] { if (m_processState == ProcessState::RetryPending) { start(); } else {