aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-08-13 16:13:29 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-08-24 08:34:38 -0400
commitddddce0e46e73d4ca369f2ce9696231cc579e1f9 (patch)
treeb4242246762d8ff5c2351925ee8907b4dd232611 /src/util.h
parentddc3ec92b0e655a3da21ac2e85ec2e7ecb66c65b (diff)
downloadbitcoin-ddddce0e46e73d4ca369f2ce9696231cc579e1f9.tar.xz
util: Replace boost::signals2 with std::function
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/util.h b/src/util.h
index 23b2a787e4..e93489c1ed 100644
--- a/src/util.h
+++ b/src/util.h
@@ -19,8 +19,8 @@
#include <logging.h>
#include <sync.h>
#include <tinyformat.h>
-#include <utiltime.h>
#include <utilmemory.h>
+#include <utiltime.h>
#include <atomic>
#include <exception>
@@ -31,33 +31,24 @@
#include <unordered_set>
#include <vector>
-#include <boost/signals2/signal.hpp>
#include <boost/thread/condition_variable.hpp> // for boost::thread_interrupted
// Application startup time (used for uptime calculation)
int64_t GetStartupTime();
-/** Signals for translation. */
-class CTranslationInterface
-{
-public:
- /** Translate a message to the native language of the user. */
- boost::signals2::signal<std::string (const char* psz)> Translate;
-};
-
-extern CTranslationInterface translationInterface;
-
extern const char * const BITCOIN_CONF_FILENAME;
extern const char * const BITCOIN_PID_FILENAME;
+/** Translate a message to the native language of the user. */
+const extern std::function<std::string(const char*)> G_TRANSLATION_FUN;
+
/**
- * Translation function: Call Translate signal on UI interface, which returns a boost::optional result.
- * If no translation slot is registered, nothing is returned, and simply return the input.
+ * Translation function.
+ * If no translation function is set, simply return the input.
*/
inline std::string _(const char* psz)
{
- boost::optional<std::string> rv = translationInterface.Translate(psz);
- return rv ? (*rv) : psz;
+ return G_TRANSLATION_FUN ? (G_TRANSLATION_FUN)(psz) : psz;
}
void SetupEnvironment();