@@ -148,11 +148,6 @@ uint256 ClientModel::getBestBlockHash()
148
148
return m_cached_tip_blocks;
149
149
}
150
150
151
- void ClientModel::updateNumConnections (int numConnections)
152
- {
153
- Q_EMIT numConnectionsChanged (numConnections);
154
- }
155
-
156
151
void ClientModel::updateNetworkActive (bool networkActive)
157
152
{
158
153
Q_EMIT networkActiveChanged (networkActive);
@@ -236,14 +231,6 @@ void ClientModel::updateBanlist()
236
231
}
237
232
238
233
// Handlers for core signals
239
- static void NotifyNumConnectionsChanged (ClientModel *clientmodel, int newNumConnections)
240
- {
241
- // Too noisy: qDebug() << "NotifyNumConnectionsChanged: " + QString::number(newNumConnections);
242
- bool invoked = QMetaObject::invokeMethod (clientmodel, " updateNumConnections" , Qt::QueuedConnection,
243
- Q_ARG (int , newNumConnections));
244
- assert (invoked);
245
- }
246
-
247
234
static void NotifyNetworkActiveChanged (ClientModel *clientmodel, bool networkActive)
248
235
{
249
236
bool invoked = QMetaObject::invokeMethod (clientmodel, " updateNetworkActive" , Qt::QueuedConnection,
@@ -301,7 +288,10 @@ void ClientModel::subscribeToCoreSignals()
301
288
[this ](const std::string& title, int progress, [[maybe_unused]] bool resume_possible) {
302
289
Q_EMIT showProgress (QString::fromStdString (title), progress);
303
290
});
304
- m_handler_notify_num_connections_changed = m_node.handleNotifyNumConnectionsChanged (std::bind (NotifyNumConnectionsChanged, this , std::placeholders::_1));
291
+ m_handler_notify_num_connections_changed = m_node.handleNotifyNumConnectionsChanged (
292
+ [this ](int new_num_connections) {
293
+ Q_EMIT numConnectionsChanged (new_num_connections);
294
+ });
305
295
m_handler_notify_network_active_changed = m_node.handleNotifyNetworkActiveChanged (std::bind (NotifyNetworkActiveChanged, this , std::placeholders::_1));
306
296
m_handler_notify_alert_changed = m_node.handleNotifyAlertChanged (std::bind (NotifyAlertChanged, this ));
307
297
m_handler_banned_list_changed = m_node.handleBannedListChanged (std::bind (BannedListChanged, this ));
0 commit comments