diff --git a/src/net_permissions.cpp b/src/net_permissions.cpp index 5f5e0ee8a3..42b4bc7b57 100644 --- a/src/net_permissions.cpp +++ b/src/net_permissions.cpp @@ -10,8 +10,8 @@ namespace { -// The parse the following format "perm1,perm2@xxxxxx" -bool TryParsePermissionFlags(const std::string str, NetPermissionFlags& output, size_t& readen, bilingual_str& error) +// Parse the following format: "perm1,perm2@xxxxxx" +bool TryParsePermissionFlags(const std::string& str, NetPermissionFlags& output, size_t& readen, bilingual_str& error) { NetPermissionFlags flags = PF_NONE; const auto atSeparator = str.find('@'); @@ -67,7 +67,7 @@ std::vector NetPermissions::ToStrings(NetPermissionFlags flags) return strings; } -bool NetWhitebindPermissions::TryParse(const std::string str, NetWhitebindPermissions& output, bilingual_str& error) +bool NetWhitebindPermissions::TryParse(const std::string& str, NetWhitebindPermissions& output, bilingual_str& error) { NetPermissionFlags flags; size_t offset; @@ -90,7 +90,7 @@ bool NetWhitebindPermissions::TryParse(const std::string str, NetWhitebindPermis return true; } -bool NetWhitelistPermissions::TryParse(const std::string str, NetWhitelistPermissions& output, bilingual_str& error) +bool NetWhitelistPermissions::TryParse(const std::string& str, NetWhitelistPermissions& output, bilingual_str& error) { NetPermissionFlags flags; size_t offset; diff --git a/src/net_permissions.h b/src/net_permissions.h index 3edbdeea4d..789c417808 100644 --- a/src/net_permissions.h +++ b/src/net_permissions.h @@ -51,14 +51,14 @@ public: class NetWhitebindPermissions : public NetPermissions { public: - static bool TryParse(const std::string str, NetWhitebindPermissions& output, bilingual_str& error); + static bool TryParse(const std::string& str, NetWhitebindPermissions& output, bilingual_str& error); CService m_service; }; class NetWhitelistPermissions : public NetPermissions { public: - static bool TryParse(const std::string str, NetWhitelistPermissions& output, bilingual_str& error); + static bool TryParse(const std::string& str, NetWhitelistPermissions& output, bilingual_str& error); CSubNet m_subnet; }; diff --git a/src/ui_interface.cpp b/src/ui_interface.cpp index bd2b7284f6..20afbe0639 100644 --- a/src/ui_interface.cpp +++ b/src/ui_interface.cpp @@ -6,14 +6,14 @@ #include -#include +#include #include CClientUIInterface uiInterface; struct UISignals { - boost::signals2::signal> ThreadSafeMessageBox; - boost::signals2::signal> ThreadSafeQuestion; + boost::signals2::signal> ThreadSafeMessageBox; + boost::signals2::signal> ThreadSafeQuestion; boost::signals2::signal InitMessage; boost::signals2::signal NotifyNumConnectionsChanged; boost::signals2::signal NotifyNetworkActiveChanged; @@ -50,8 +50,8 @@ ADD_SIGNALS_IMPL_WRAPPER(NotifyMasternodeListChanged); ADD_SIGNALS_IMPL_WRAPPER(NotifyAdditionalDataSyncProgressChanged); ADD_SIGNALS_IMPL_WRAPPER(BannedListChanged); -bool CClientUIInterface::ThreadSafeMessageBox(const bilingual_str& message, const std::string& caption, unsigned int style) { return g_ui_signals.ThreadSafeMessageBox(message, caption, style); } -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); } +bool CClientUIInterface::ThreadSafeMessageBox(const bilingual_str& message, const std::string& caption, unsigned int style) { return g_ui_signals.ThreadSafeMessageBox(message, caption, style).value_or(false);} +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); } diff --git a/src/ui_interface.h b/src/ui_interface.h index b03df680ee..beed4d431d 100644 --- a/src/ui_interface.h +++ b/src/ui_interface.h @@ -139,7 +139,7 @@ void InitWarning(const bilingual_str& str); /** Show error message **/ bool InitError(const bilingual_str& str); -constexpr auto AbortError = InitError; +inline bool AbortError(const bilingual_str& str) { return InitError(str); } extern CClientUIInterface uiInterface; diff --git a/test/lint/lint-includes.sh b/test/lint/lint-includes.sh index e8c0ead871..74b4f9bdfd 100755 --- a/test/lint/lint-includes.sh +++ b/test/lint/lint-includes.sh @@ -67,7 +67,7 @@ EXPECTED_BOOST_INCLUDES=( boost/preprocessor/cat.hpp boost/preprocessor/stringize.hpp boost/signals2/connection.hpp - boost/signals2/last_value.hpp + boost/signals2/optional_last_value.hpp boost/signals2/signal.hpp boost/test/unit_test.hpp boost/thread.hpp