Skip to content

Commit

Permalink
qt: Remove redundant BitcoinGUI::setTrayIconVisible
Browse files Browse the repository at this point in the history
The removed BitcoinGUI::setTrayIconVisible just duplicates
QSystemTrayIcon::setVisible.
  • Loading branch information
hebasto committed Oct 24, 2020
1 parent 87e38a6 commit a124ee7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
11 changes: 2 additions & 9 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()))
Expand Down
3 changes: 0 additions & 3 deletions src/qt/bitcoingui.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};

Expand Down

0 comments on commit a124ee7

Please sign in to comment.