mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-13 11:35:20 +01:00
refactor: Use TranslateFn type consistently
The type was introduced in the previous commit.
This commit is contained in:
parent
eeee6cf2ff
commit
fa1d5acb8d
8 changed files with 9 additions and 8 deletions
|
@ -50,7 +50,7 @@ using util::ToString;
|
|||
// just use a plain system_clock.
|
||||
using CliClock = std::chrono::system_clock;
|
||||
|
||||
const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;
|
||||
const TranslateFn G_TRANSLATION_FUN{nullptr};
|
||||
|
||||
static const char DEFAULT_RPCCONNECT[] = "127.0.0.1";
|
||||
static const int DEFAULT_HTTP_CLIENT_TIMEOUT=900;
|
||||
|
|
|
@ -41,7 +41,7 @@ static bool fCreateBlank;
|
|||
static std::map<std::string,UniValue> registers;
|
||||
static const int CONTINUE_EXECUTION=-1;
|
||||
|
||||
const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;
|
||||
const TranslateFn G_TRANSLATION_FUN{nullptr};
|
||||
|
||||
static void SetupBitcoinTxArgs(ArgsManager &argsman)
|
||||
{
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
static const int CONTINUE_EXECUTION=-1;
|
||||
|
||||
const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;
|
||||
const TranslateFn G_TRANSLATION_FUN{nullptr};
|
||||
|
||||
static void SetupBitcoinUtilArgs(ArgsManager &argsman)
|
||||
{
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
using util::Join;
|
||||
|
||||
const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;
|
||||
const TranslateFn G_TRANSLATION_FUN{nullptr};
|
||||
|
||||
static void SetupWalletToolArgs(ArgsManager& argsman)
|
||||
{
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
using node::NodeContext;
|
||||
|
||||
const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;
|
||||
const TranslateFn G_TRANSLATION_FUN{nullptr};
|
||||
|
||||
#if HAVE_DECL_FORK
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
// Copyright (c) 2022 The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
#include <util/translation.h>
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
// Define G_TRANSLATION_FUN symbol in libbitcoinkernel library so users of the
|
||||
// library aren't required to export this symbol
|
||||
extern const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;
|
||||
extern const TranslateFn G_TRANSLATION_FUN{nullptr};
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include <string>
|
||||
|
||||
/** Translate string to current locale using Qt. */
|
||||
extern const std::function<std::string(const char*)> G_TRANSLATION_FUN = [](const char* psz) {
|
||||
extern const TranslateFn G_TRANSLATION_FUN = [](const char* psz) {
|
||||
return QCoreApplication::translate("bitcoin-core", psz).toStdString();
|
||||
};
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ using node::LoadChainstate;
|
|||
using node::RegenerateCommitments;
|
||||
using node::VerifyLoadedChainstate;
|
||||
|
||||
const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;
|
||||
const TranslateFn G_TRANSLATION_FUN{nullptr};
|
||||
|
||||
constexpr inline auto TEST_DIR_PATH_ELEMENT{"test_common bitcoin"}; // Includes a space to catch possible path escape issues.
|
||||
/** Random context to get unique temp data dirs. Separate from m_rng, which can be seeded from a const env var */
|
||||
|
|
Loading…
Add table
Reference in a new issue