mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
qt: Revamp ClientModel code to handle AlertChanged core signal
No behavior change.
This commit is contained in:
parent
bfe5140c50
commit
36b12af7ee
2 changed files with 5 additions and 14 deletions
|
@ -148,11 +148,6 @@ uint256 ClientModel::getBestBlockHash()
|
|||
return m_cached_tip_blocks;
|
||||
}
|
||||
|
||||
void ClientModel::updateAlert()
|
||||
{
|
||||
Q_EMIT alertsChanged(getStatusBarWarnings());
|
||||
}
|
||||
|
||||
enum BlockSource ClientModel::getBlockSource() const
|
||||
{
|
||||
if (m_node.getReindex())
|
||||
|
@ -226,13 +221,6 @@ void ClientModel::updateBanlist()
|
|||
}
|
||||
|
||||
// Handlers for core signals
|
||||
static void NotifyAlertChanged(ClientModel *clientmodel)
|
||||
{
|
||||
qDebug() << "NotifyAlertChanged";
|
||||
bool invoked = QMetaObject::invokeMethod(clientmodel, "updateAlert", Qt::QueuedConnection);
|
||||
assert(invoked);
|
||||
}
|
||||
|
||||
static void BannedListChanged(ClientModel *clientmodel)
|
||||
{
|
||||
qDebug() << QString("%1: Requesting update for peer banlist").arg(__func__);
|
||||
|
@ -284,7 +272,11 @@ void ClientModel::subscribeToCoreSignals()
|
|||
[this](bool network_active) {
|
||||
Q_EMIT networkActiveChanged(network_active);
|
||||
});
|
||||
m_handler_notify_alert_changed = m_node.handleNotifyAlertChanged(std::bind(NotifyAlertChanged, this));
|
||||
m_handler_notify_alert_changed = m_node.handleNotifyAlertChanged(
|
||||
[this]() {
|
||||
qDebug() << "ClientModel: NotifyAlertChanged";
|
||||
Q_EMIT alertsChanged(getStatusBarWarnings());
|
||||
});
|
||||
m_handler_banned_list_changed = m_node.handleBannedListChanged(std::bind(BannedListChanged, this));
|
||||
m_handler_notify_block_tip = m_node.handleNotifyBlockTip(std::bind(BlockTipChanged, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, false));
|
||||
m_handler_notify_header_tip = m_node.handleNotifyHeaderTip(std::bind(BlockTipChanged, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, true));
|
||||
|
|
|
@ -122,7 +122,6 @@ Q_SIGNALS:
|
|||
void showProgress(const QString &title, int nProgress);
|
||||
|
||||
public Q_SLOTS:
|
||||
void updateAlert();
|
||||
void updateBanlist();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue