From 727af0f0c00092f473368aa4d7cad7c321d4a4de Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 11 Sep 2020 01:45:44 +0300 Subject: [PATCH] Drop unused argument in NetworkActiveChanged signal --- src/interfaces/node.h | 2 +- src/net.cpp | 2 +- src/node/ui_interface.cpp | 2 +- src/node/ui_interface.h | 2 +- src/qt/bitcoingui.cpp | 2 +- src/qt/bitcoingui.h | 2 +- src/qt/clientmodel.cpp | 11 +++++------ src/qt/clientmodel.h | 4 ++-- src/qt/rpcconsole.cpp | 2 +- src/qt/rpcconsole.h | 2 +- 10 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/interfaces/node.h b/src/interfaces/node.h index 5079be038eb..ea5505e3c0f 100644 --- a/src/interfaces/node.h +++ b/src/interfaces/node.h @@ -200,7 +200,7 @@ class Node virtual std::unique_ptr handleNotifyNumConnectionsChanged(NotifyNumConnectionsChangedFn fn) = 0; //! Register handler for network active messages. - using NotifyNetworkActiveChangedFn = std::function; + using NotifyNetworkActiveChangedFn = std::function; virtual std::unique_ptr handleNotifyNetworkActiveChanged(NotifyNetworkActiveChangedFn fn) = 0; //! Register handler for notify alert messages. diff --git a/src/net.cpp b/src/net.cpp index 0f4956f1409..0578f181dd8 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2282,7 +2282,7 @@ void CConnman::SetNetworkActive(bool active) fNetworkActive = active; if (clientInterface) { - clientInterface->NotifyNetworkActiveChanged(fNetworkActive); + clientInterface->NotifyNetworkActiveChanged(); } } diff --git a/src/node/ui_interface.cpp b/src/node/ui_interface.cpp index 8d3665975dc..103b268ea35 100644 --- a/src/node/ui_interface.cpp +++ b/src/node/ui_interface.cpp @@ -46,7 +46,7 @@ bool CClientUIInterface::ThreadSafeMessageBox(const bilingual_str& message, cons bool CClientUIInterface::ThreadSafeQuestion(const bilingual_str& message, const std::string& non_interactive_message, const std::string& caption, unsigned int style) { return g_ui_signals.ThreadSafeQuestion(message, non_interactive_message, caption, style).value_or(false);} void CClientUIInterface::InitMessage(const std::string& message) { return g_ui_signals.InitMessage(message); } void CClientUIInterface::NotifyNumConnectionsChanged(int newNumConnections) { return g_ui_signals.NotifyNumConnectionsChanged(newNumConnections); } -void CClientUIInterface::NotifyNetworkActiveChanged(bool networkActive) { return g_ui_signals.NotifyNetworkActiveChanged(networkActive); } +void CClientUIInterface::NotifyNetworkActiveChanged() { return g_ui_signals.NotifyNetworkActiveChanged(); } void CClientUIInterface::NotifyAlertChanged() { return g_ui_signals.NotifyAlertChanged(); } void CClientUIInterface::ShowProgress(const std::string& title, int nProgress, bool resume_possible) { return g_ui_signals.ShowProgress(title, nProgress, resume_possible); } void CClientUIInterface::NotifyBlockTip(SynchronizationState s, const CBlockIndex* i) { return g_ui_signals.NotifyBlockTip(s, i); } diff --git a/src/node/ui_interface.h b/src/node/ui_interface.h index d574ab879f9..7d7135e6066 100644 --- a/src/node/ui_interface.h +++ b/src/node/ui_interface.h @@ -86,7 +86,7 @@ class CClientUIInterface ADD_SIGNALS_DECL_WRAPPER(NotifyNumConnectionsChanged, void, int newNumConnections); /** Network activity state changed. */ - ADD_SIGNALS_DECL_WRAPPER(NotifyNetworkActiveChanged, void, bool networkActive); + ADD_SIGNALS_DECL_WRAPPER(NotifyNetworkActiveChanged, void, void); /** * Status bar alerts changed. diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index aa58c0b10e7..b830ee1acdc 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -925,7 +925,7 @@ void BitcoinGUI::setNumConnections(int count) updateNetworkState(); } -void BitcoinGUI::setNetworkActive(bool networkActive) +void BitcoinGUI::setNetworkActive() { updateNetworkState(); } diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 4c55f286932..d5cfb21c056 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -219,7 +219,7 @@ public Q_SLOTS: /** Set number of connections shown in the UI */ void setNumConnections(int count); /** Set network state shown in the UI */ - void setNetworkActive(bool networkActive); + void setNetworkActive(); /** Set number of blocks and last block date shown in the UI */ void setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool headers, SynchronizationState sync_state); diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 7822d4c5f3a..e172b65db42 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -142,9 +142,9 @@ void ClientModel::updateNumConnections(int numConnections) Q_EMIT numConnectionsChanged(numConnections); } -void ClientModel::updateNetworkActive(bool networkActive) +void ClientModel::updateNetworkActive() { - Q_EMIT networkActiveChanged(networkActive); + Q_EMIT networkActiveChanged(); } void ClientModel::updateAlert() @@ -237,10 +237,9 @@ static void NotifyNumConnectionsChanged(ClientModel *clientmodel, int newNumConn assert(invoked); } -static void NotifyNetworkActiveChanged(ClientModel *clientmodel, bool networkActive) +static void NotifyNetworkActiveChanged(ClientModel* clientmodel) { - bool invoked = QMetaObject::invokeMethod(clientmodel, "updateNetworkActive", Qt::QueuedConnection, - Q_ARG(bool, networkActive)); + bool invoked = QMetaObject::invokeMethod(clientmodel, "updateNetworkActive", Qt::QueuedConnection); assert(invoked); } @@ -292,7 +291,7 @@ void ClientModel::subscribeToCoreSignals() // Connect signals to client m_handler_show_progress = m_node.handleShowProgress(std::bind(ShowProgress, this, std::placeholders::_1, std::placeholders::_2)); m_handler_notify_num_connections_changed = m_node.handleNotifyNumConnectionsChanged(std::bind(NotifyNumConnectionsChanged, this, std::placeholders::_1)); - m_handler_notify_network_active_changed = m_node.handleNotifyNetworkActiveChanged(std::bind(NotifyNetworkActiveChanged, this, std::placeholders::_1)); + m_handler_notify_network_active_changed = m_node.handleNotifyNetworkActiveChanged(std::bind(NotifyNetworkActiveChanged, this)); m_handler_notify_alert_changed = m_node.handleNotifyAlertChanged(std::bind(NotifyAlertChanged, this)); 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)); diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index 7f12cce1d91..af643d1a0c1 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -108,7 +108,7 @@ class ClientModel : public QObject void numConnectionsChanged(int count); void numBlocksChanged(int count, const QDateTime& blockDate, double nVerificationProgress, bool header, SynchronizationState sync_state); void mempoolSizeChanged(long count, size_t mempoolSizeInBytes); - void networkActiveChanged(bool networkActive); + void networkActiveChanged(); void alertsChanged(const QString &warnings); void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut); @@ -120,7 +120,7 @@ class ClientModel : public QObject public Q_SLOTS: void updateNumConnections(int numConnections); - void updateNetworkActive(bool networkActive); + void updateNetworkActive(); void updateAlert(); void updateBanlist(); }; diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index a14fae6460c..25d6e0f8d52 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -862,7 +862,7 @@ void RPCConsole::setNumConnections(int count) updateNetworkState(); } -void RPCConsole::setNetworkActive(bool networkActive) +void RPCConsole::setNetworkActive() { updateNetworkState(); } diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 280c5bd71a9..008ded143fc 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -106,7 +106,7 @@ public Q_SLOTS: /** Set number of connections shown in the UI */ void setNumConnections(int count); /** Set network state shown in the UI */ - void setNetworkActive(bool networkActive); + void setNetworkActive(); /** Set number of blocks and last block date shown in the UI */ void setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool headers); /** Set size (number of transactions and memory usage) of the mempool in the UI */