diff --git a/libdevcore/CommonJS.cpp b/libdevcore/CommonJS.cpp index 9dc04b7e7..ad3ade71f 100644 --- a/libdevcore/CommonJS.cpp +++ b/libdevcore/CommonJS.cpp @@ -105,13 +105,8 @@ std::string fromRaw(h256 _n, unsigned* _inc) return ""; } -Address fromString(std::string _sn) +Address fromString(std::string const& _sn) { - if (_sn.size() > 32) - _sn.resize(32); - h256 n; - memcpy(n.data(), _sn.data(), _sn.size()); - memset(n.data() + _sn.size(), 0, 32 - _sn.size()); if (_sn.size() == 40) return Address(fromHex(_sn)); else diff --git a/libdevcore/CommonJS.h b/libdevcore/CommonJS.h index 0fb087f72..8b96b2e68 100644 --- a/libdevcore/CommonJS.h +++ b/libdevcore/CommonJS.h @@ -51,7 +51,7 @@ bytes padded(bytes _b, unsigned _l); bytes unpadded(bytes _s); std::string prettyU256(u256 _n); std::string fromRaw(h256 _n, unsigned* _inc = nullptr); -Address fromString(std::string _a); +Address fromString(std::string const& _a); template FixedHash jsToFixed(std::string const& _s) { diff --git a/mix/AssemblyDebuggerCtrl.cpp b/mix/AssemblyDebuggerCtrl.cpp index 36318ccb7..678f94d77 100644 --- a/mix/AssemblyDebuggerCtrl.cpp +++ b/mix/AssemblyDebuggerCtrl.cpp @@ -47,7 +47,7 @@ QString AssemblyDebuggerCtrl::contentUrl() const QString AssemblyDebuggerCtrl::title() const { - return "debugger"; + return QApplication::tr("debugger"); } void AssemblyDebuggerCtrl::start() const @@ -63,7 +63,6 @@ void AssemblyDebuggerCtrl::keyPressed(int _key) QString code = m_doc->toPlainText(); QtConcurrent::run([this, code]() { - if (!m_modelDebugger->compile(m_doc->toPlainText())) { emit dataAvailable(false, DebuggingStatusResult::Compilationfailed); @@ -101,5 +100,5 @@ void AssemblyDebuggerCtrl::updateGUI(bool success, DebuggingStatusResult reason, this->addContentOn(this); } else - m_ctx->displayMessageDialog("debugger","compilation failed"); + m_ctx->displayMessageDialog(QApplication::tr("debugger"), QApplication::tr("compilation failed")); } diff --git a/mix/AssemblyDebuggerModel.cpp b/mix/AssemblyDebuggerModel.cpp index bcf58835c..ad6ba156d 100644 --- a/mix/AssemblyDebuggerModel.cpp +++ b/mix/AssemblyDebuggerModel.cpp @@ -17,6 +17,7 @@ * used as a model to debug contract assembly code. */ +#include #include "libethereum/Executive.h" #include "libethereum/Transaction.h" #include "libethereum/ExtVM.h" @@ -90,7 +91,7 @@ DebuggingContent AssemblyDebuggerModel::getContractInitiationDebugStates(dev::u2 { DebuggingContent r; r.contentAvailable = false; - r.message = "compile failed"; + r.message = QApplication::tr("compilation failed"); return r; } diff --git a/mix/ConstantCompilationCtrl.cpp b/mix/ConstantCompilationCtrl.cpp index 8b0577d93..3ccd87f77 100644 --- a/mix/ConstantCompilationCtrl.cpp +++ b/mix/ConstantCompilationCtrl.cpp @@ -43,7 +43,7 @@ QString ConstantCompilationCtrl::contentUrl() const QString ConstantCompilationCtrl::title() const { - return "compiler"; + return QApplication::tr("compiler"); } void ConstantCompilationCtrl::start() const @@ -80,13 +80,13 @@ void ConstantCompilationCtrl::writeOutPut(CompilerResult const& _res) status->setProperty("text", "succeeded"); status->setProperty("color", "green"); content->setProperty("text", _res.hexCode); - qDebug() << QString("compile succeeded " + _res.hexCode); + qDebug() << QString(QApplication::tr("compile succeeded") + " " + _res.hexCode); } else { status->setProperty("text", "failure"); status->setProperty("color", "red"); content->setProperty("text", _res.comment); - qDebug() << QString("compile failed " + _res.comment); + qDebug() << QString(QApplication::tr("compile failed") + " " + _res.comment); } } diff --git a/mix/ConstantCompilationModel.cpp b/mix/ConstantCompilationModel.cpp index f50ac805b..817d01635 100644 --- a/mix/ConstantCompilationModel.cpp +++ b/mix/ConstantCompilationModel.cpp @@ -20,6 +20,7 @@ * Ethereum IDE client. */ +#include #include #include #include @@ -55,7 +56,7 @@ CompilerResult ConstantCompilationModel::compile(QString _code) catch (...) { res.success = false; - res.comment = "Uncaught exception."; + res.comment = QApplication::tr("Uncaught exception."); res.hexCode = ""; } return res; diff --git a/mix/KeyEventManager.cpp b/mix/KeyEventManager.cpp index f5d638869..c32caadb8 100644 --- a/mix/KeyEventManager.cpp +++ b/mix/KeyEventManager.cpp @@ -39,5 +39,3 @@ void KeyEventManager::keyPressed(QVariant _event) { emit onKeyPressed(_event.toInt()); } - -