mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-31 18:51:12 +00:00
refactor: [gui] Use lambdas over std::bind
This refactor makes the code easier to read and maintain.
This commit is contained in:
parent
eeee1e341f
commit
fa0195499c
@ -41,8 +41,6 @@
|
||||
#include <util/translation.h>
|
||||
#include <validation.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include <QAction>
|
||||
#include <QActionGroup>
|
||||
#include <QApplication>
|
||||
@ -1617,8 +1615,12 @@ static bool ThreadSafeMessageBox(BitcoinGUI* gui, const bilingual_str& message,
|
||||
void BitcoinGUI::subscribeToCoreSignals()
|
||||
{
|
||||
// Connect signals to client
|
||||
m_handler_message_box = m_node.handleMessageBox(std::bind(ThreadSafeMessageBox, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
m_handler_question = m_node.handleQuestion(std::bind(ThreadSafeMessageBox, this, std::placeholders::_1, std::placeholders::_3, std::placeholders::_4));
|
||||
m_handler_message_box = m_node.handleMessageBox([this](const bilingual_str& message, const std::string& caption, unsigned int style) {
|
||||
return ThreadSafeMessageBox(this, message, caption, style);
|
||||
});
|
||||
m_handler_question = m_node.handleQuestion([this](const bilingual_str& message, const std::string& /*non_interactive_message*/, const std::string& caption, unsigned int style) {
|
||||
return ThreadSafeMessageBox(this, message, caption, style);
|
||||
});
|
||||
}
|
||||
|
||||
void BitcoinGUI::unsubscribeFromCoreSignals()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user