From a124ee763e294a75871823c642f55f46633cdb31 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sun, 25 Oct 2020 01:14:32 +0300 Subject: [PATCH] qt: Remove redundant BitcoinGUI::setTrayIconVisible The removed BitcoinGUI::setTrayIconVisible just duplicates QSystemTrayIcon::setVisible. --- src/qt/bitcoingui.cpp | 11 ++--------- src/qt/bitcoingui.h | 3 --- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index f902c989ea4..c9a260fc5fb 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -615,10 +615,10 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH OptionsModel* optionsModel = _clientModel->getOptionsModel(); if (optionsModel && trayIcon) { // be aware of the tray icon disable state change reported by the OptionsModel object. - connect(optionsModel, &OptionsModel::showTrayIconChanged, this, &BitcoinGUI::setTrayIconVisible); + connect(optionsModel, &OptionsModel::showTrayIconChanged, trayIcon, &QSystemTrayIcon::setVisible); // initialize the disable state of the tray icon with the current value in the model. - setTrayIconVisible(optionsModel->getShowTrayIcon()); + trayIcon->setVisible(optionsModel->getShowTrayIcon()); } } else { // Disable possibility to show main window via action @@ -1387,13 +1387,6 @@ void BitcoinGUI::showProgress(const QString &title, int nProgress) } } -void BitcoinGUI::setTrayIconVisible(bool show_tray_con) -{ - if (trayIcon) { - trayIcon->setVisible(show_tray_con); - } -} - void BitcoinGUI::showModalOverlay() { if (modalOverlay && (progressBar->isVisible() || modalOverlay->isLayerVisible())) diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 91c013fd11d..1685554e445 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -317,9 +317,6 @@ public Q_SLOTS: /** Show progress dialog e.g. for verifychain */ void showProgress(const QString &title, int nProgress); - /** When showTrayIcon setting is changed in OptionsModel show or hide the icon accordingly. */ - void setTrayIconVisible(bool); - void showModalOverlay(); };