From c3ca8364b2a8de8c73ecc0c7eed9608bd30e7e02 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 8 Feb 2022 16:19:12 +0200 Subject: [PATCH] qt, refactor: Replace BitcoinGUI::macosDockIconActivated with a lambda --- src/qt/bitcoingui.cpp | 11 ++++------- src/qt/bitcoingui.h | 3 --- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 0baacfe58cd..ca351060fd4 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -793,7 +793,10 @@ void BitcoinGUI::createTrayIconMenu() #else // Note: On macOS, the Dock icon is used to provide the tray's functionality. MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance(); - connect(dockIconHandler, &MacDockIconHandler::dockIconClicked, this, &BitcoinGUI::macosDockIconActivated); + connect(dockIconHandler, &MacDockIconHandler::dockIconClicked, [this] { + show(); + activateWindow(); + }); trayIconMenu->setAsDockMenu(); #endif @@ -828,12 +831,6 @@ void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason) toggleHidden(); } } -#else -void BitcoinGUI::macosDockIconActivated() -{ - show(); - activateWindow(); -} #endif void BitcoinGUI::optionsClicked() diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 658ab5a2109..ae9cb9f11d4 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -305,9 +305,6 @@ public Q_SLOTS: #ifndef Q_OS_MAC /** Handle tray icon clicked */ void trayIconActivated(QSystemTrayIcon::ActivationReason reason); -#else - /** Handle macOS Dock icon clicked */ - void macosDockIconActivated(); #endif /** Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true */