[pim/trojita] src/Gui: Add context object to QObject::connect with lambda

Espen Sandøy Hustad <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 7f83b6152014709e5746df732416a646a7d89368 by Espen Sandøy Hustad.
Committed on 02/08/2026 at 16:48.
Pushed by ehustad into branch 'master'.

Add context object to QObject::connect with lambda

Fix Clazy warning: Pass a context object as 3rd
connect parameter [-Wclazy-connect-3arg-lambda]

M  +1    -1    src/Gui/Window.cpp

https://invent.kde.org/pim/trojita/-/commit/7f83b6152014709e5746df732416a646a7d89368

diff --git a/src/Gui/Window.cpp b/src/Gui/Window.cpp
index de4e67d56..15e559d86 100644
--- a/src/Gui/Window.cpp
+++ b/src/Gui/Window.cpp
@@ -649,7 +649,7 @@ void MainWindow::createActions()
     m_menuFromToolBar->setPopupMode(QToolButton::MenuButtonPopup);
     connect(m_menuFromToolBar, &QAbstractButton::clicked, m_menuFromToolBar, &QToolButton::showMenu);
     m_mainToolbar->addWidget(m_menuFromToolBar);
-    connect(showMenuBar, &QAction::toggled, [this](const bool menuBarVisible) {
+    connect(showMenuBar, &QAction::toggled, this, [this](const bool menuBarVisible) {
         // https://bugreports.qt.io/browse/QTBUG-35768 , we have to work on the QAction, not QToolButton
         m_mainToolbar->actions().last()->setVisible(!menuBarVisible);
     });
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.