Skip to content

Commit

Permalink
Drop unused argument in NetworkActiveChanged signal
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Sep 11, 2020
1 parent bd92406 commit 727af0f
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/interfaces/node.h
Expand Up @@ -200,7 +200,7 @@ class Node
virtual std::unique_ptr<Handler> handleNotifyNumConnectionsChanged(NotifyNumConnectionsChangedFn fn) = 0;

//! Register handler for network active messages.
using NotifyNetworkActiveChangedFn = std::function<void(bool network_active)>;
using NotifyNetworkActiveChangedFn = std::function<void()>;
virtual std::unique_ptr<Handler> handleNotifyNetworkActiveChanged(NotifyNetworkActiveChangedFn fn) = 0;

//! Register handler for notify alert messages.
Expand Down
2 changes: 1 addition & 1 deletion src/net.cpp
Expand Up @@ -2282,7 +2282,7 @@ void CConnman::SetNetworkActive(bool active)

fNetworkActive = active;
if (clientInterface) {
clientInterface->NotifyNetworkActiveChanged(fNetworkActive);
clientInterface->NotifyNetworkActiveChanged();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/node/ui_interface.cpp
Expand Up @@ -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); }
Expand Down
2 changes: 1 addition & 1 deletion src/node/ui_interface.h
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/qt/bitcoingui.cpp
Expand Up @@ -925,7 +925,7 @@ void BitcoinGUI::setNumConnections(int count)
updateNetworkState();
}

void BitcoinGUI::setNetworkActive(bool networkActive)
void BitcoinGUI::setNetworkActive()
{
updateNetworkState();
}
Expand Down
2 changes: 1 addition & 1 deletion src/qt/bitcoingui.h
Expand Up @@ -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);

Expand Down
11 changes: 5 additions & 6 deletions src/qt/clientmodel.cpp
Expand Up @@ -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()
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions src/qt/clientmodel.h
Expand Up @@ -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);

Expand All @@ -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();
};
Expand Down
2 changes: 1 addition & 1 deletion src/qt/rpcconsole.cpp
Expand Up @@ -862,7 +862,7 @@ void RPCConsole::setNumConnections(int count)
updateNetworkState();
}

void RPCConsole::setNetworkActive(bool networkActive)
void RPCConsole::setNetworkActive()
{
updateNetworkState();
}
Expand Down
2 changes: 1 addition & 1 deletion src/qt/rpcconsole.h
Expand Up @@ -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 */
Expand Down

0 comments on commit 727af0f

Please sign in to comment.