mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-17 01:58:57 +02:00
refactor: Make scoped_connection ctor explicit
This ensures that all constructions of scoped connections are explict, making the intent explicit and review easier. This also follows the default recommendation from https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c46-by-default-declare-single-argument-constructors-explicit
This commit is contained in:
@@ -122,7 +122,7 @@ class scoped_connection
|
||||
connection m_conn;
|
||||
|
||||
public:
|
||||
scoped_connection(connection rhs) noexcept : m_conn{std::move(rhs)} {}
|
||||
explicit scoped_connection(connection rhs) noexcept : m_conn{std::move(rhs)} {}
|
||||
|
||||
scoped_connection(scoped_connection&&) noexcept = default;
|
||||
|
||||
|
||||
@@ -485,9 +485,9 @@ int GuiMain(int argc, char* argv[])
|
||||
util::ThreadSetInternalName("main");
|
||||
|
||||
// Subscribe to global signals from core
|
||||
btcsignals::scoped_connection handler_message_box = ::uiInterface.ThreadSafeMessageBox_connect(noui_ThreadSafeMessageBox);
|
||||
btcsignals::scoped_connection handler_question = ::uiInterface.ThreadSafeQuestion_connect(noui_ThreadSafeQuestion);
|
||||
btcsignals::scoped_connection handler_init_message = ::uiInterface.InitMessage_connect(noui_InitMessage);
|
||||
btcsignals::scoped_connection handler_message_box{::uiInterface.ThreadSafeMessageBox_connect(noui_ThreadSafeMessageBox)};
|
||||
btcsignals::scoped_connection handler_question{::uiInterface.ThreadSafeQuestion_connect(noui_ThreadSafeQuestion)};
|
||||
btcsignals::scoped_connection handler_init_message{::uiInterface.InitMessage_connect(noui_InitMessage)};
|
||||
|
||||
// Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory
|
||||
|
||||
|
||||
Reference in New Issue
Block a user