From ddc24ffb22ccc5a36ca2b2d2bb900941af9b05b6 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Mon, 3 Feb 2025 20:03:31 -0500 Subject: [PATCH] refactor: MainWindow don't use lambda where direct connect can happen --- src/apps/deskflow-gui/MainWindow.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/apps/deskflow-gui/MainWindow.cpp b/src/apps/deskflow-gui/MainWindow.cpp index bd985796f..badf3190b 100644 --- a/src/apps/deskflow-gui/MainWindow.cpp +++ b/src/apps/deskflow-gui/MainWindow.cpp @@ -231,10 +231,7 @@ void MainWindow::setupControls() void MainWindow::connectSlots() { - connect( - &Logger::instance(), &Logger::newLine, this, // - [this](const QString &line) { handleLogLine(line); } - ); + connect(&Logger::instance(), &Logger::newLine, this, &MainWindow::handleLogLine); connect(this, &MainWindow::shown, this, &MainWindow::onShown, Qt::QueuedConnection); @@ -250,10 +247,7 @@ void MainWindow::connectSlots() connect(&m_coreProcess, &CoreProcess::error, this, &MainWindow::onCoreProcessError); - connect( - &m_coreProcess, &CoreProcess::logLine, this, // - [this](const QString &line) { handleLogLine(line); } - ); + connect(&m_coreProcess, &CoreProcess::logLine, this, &MainWindow::handleLogLine); connect(&m_coreProcess, &CoreProcess::processStateChanged, this, &MainWindow::onCoreProcessStateChanged); @@ -339,7 +333,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, this, [] { messages::raiseCriticalDialog(); }); + QTimer::singleShot(kCriticalDialogDelay, this, &messages::raiseCriticalDialog); } void MainWindow::onConfigScopesSaving()