Changeset View
Changeset View
Standalone View
Standalone View
src/qt/clientmodel.cpp
Show First 20 Lines • Show All 230 Lines • ▼ Show 20 Lines | if (!initialSync || now - nLastUpdateNotification > MODEL_UPDATE_DELAY) { | ||||
Q_ARG(QDateTime, QDateTime::fromTime_t(blockTime)), | Q_ARG(QDateTime, QDateTime::fromTime_t(blockTime)), | ||||
Q_ARG(double, verificationProgress), Q_ARG(bool, fHeader)); | Q_ARG(double, verificationProgress), Q_ARG(bool, fHeader)); | ||||
nLastUpdateNotification = now; | nLastUpdateNotification = now; | ||||
} | } | ||||
} | } | ||||
void ClientModel::subscribeToCoreSignals() { | void ClientModel::subscribeToCoreSignals() { | ||||
// Connect signals to client | // Connect signals to client | ||||
m_handler_show_progress = | m_handler_show_progress = m_node.handleShowProgress(std::bind( | ||||
m_node.handleShowProgress(boost::bind(ShowProgress, this, _1, _2)); | ShowProgress, this, std::placeholders::_1, std::placeholders::_2)); | ||||
m_handler_notify_num_connections_changed = | m_handler_notify_num_connections_changed = | ||||
m_node.handleNotifyNumConnectionsChanged( | m_node.handleNotifyNumConnectionsChanged(std::bind( | ||||
boost::bind(NotifyNumConnectionsChanged, this, _1)); | NotifyNumConnectionsChanged, this, std::placeholders::_1)); | ||||
m_handler_notify_network_active_changed = | m_handler_notify_network_active_changed = | ||||
m_node.handleNotifyNetworkActiveChanged( | m_node.handleNotifyNetworkActiveChanged( | ||||
boost::bind(NotifyNetworkActiveChanged, this, _1)); | std::bind(NotifyNetworkActiveChanged, this, std::placeholders::_1)); | ||||
m_handler_notify_alert_changed = | m_handler_notify_alert_changed = | ||||
m_node.handleNotifyAlertChanged(boost::bind(NotifyAlertChanged, this)); | m_node.handleNotifyAlertChanged(std::bind(NotifyAlertChanged, this)); | ||||
m_handler_banned_list_changed = | m_handler_banned_list_changed = | ||||
m_node.handleBannedListChanged(boost::bind(BannedListChanged, this)); | m_node.handleBannedListChanged(std::bind(BannedListChanged, this)); | ||||
m_handler_notify_block_tip = m_node.handleNotifyBlockTip( | m_handler_notify_block_tip = m_node.handleNotifyBlockTip(std::bind( | ||||
boost::bind(BlockTipChanged, this, _1, _2, _3, _4, false)); | BlockTipChanged, this, std::placeholders::_1, std::placeholders::_2, | ||||
m_handler_notify_header_tip = m_node.handleNotifyHeaderTip( | std::placeholders::_3, std::placeholders::_4, false)); | ||||
boost::bind(BlockTipChanged, this, _1, _2, _3, _4, true)); | m_handler_notify_header_tip = m_node.handleNotifyHeaderTip(std::bind( | ||||
BlockTipChanged, this, std::placeholders::_1, std::placeholders::_2, | |||||
std::placeholders::_3, std::placeholders::_4, true)); | |||||
} | } | ||||
void ClientModel::unsubscribeFromCoreSignals() { | void ClientModel::unsubscribeFromCoreSignals() { | ||||
// Disconnect signals from client | // Disconnect signals from client | ||||
m_handler_show_progress->disconnect(); | m_handler_show_progress->disconnect(); | ||||
m_handler_notify_num_connections_changed->disconnect(); | m_handler_notify_num_connections_changed->disconnect(); | ||||
m_handler_notify_network_active_changed->disconnect(); | m_handler_notify_network_active_changed->disconnect(); | ||||
m_handler_notify_alert_changed->disconnect(); | m_handler_notify_alert_changed->disconnect(); | ||||
m_handler_banned_list_changed->disconnect(); | m_handler_banned_list_changed->disconnect(); | ||||
m_handler_notify_block_tip->disconnect(); | m_handler_notify_block_tip->disconnect(); | ||||
m_handler_notify_header_tip->disconnect(); | m_handler_notify_header_tip->disconnect(); | ||||
} | } |