forked from lthn/blockchain
small tweak for bridge serialization
This commit is contained in:
parent
cb08646fc1
commit
af49225221
3 changed files with 15 additions and 7 deletions
|
|
@ -121,8 +121,13 @@ namespace epee
|
|||
boost::split(pod_items, a, boost::is_any_of(", ][\""));
|
||||
|
||||
t_pod_container_type res;
|
||||
if (!a.size())
|
||||
return res;
|
||||
for (const auto& item : pod_items)
|
||||
{
|
||||
if(!item.size())
|
||||
continue;
|
||||
|
||||
res.resize(res.size() + 1);
|
||||
typename t_pod_container_type::value_type& pod_val = res.back();
|
||||
|
||||
|
|
|
|||
|
|
@ -978,18 +978,21 @@ QString MainWindow::start_backend(const QString& params)
|
|||
|
||||
QString MainWindow::sync_call(const QString& func_name, const QString& params)
|
||||
{
|
||||
if (func_name == "transfer")
|
||||
{
|
||||
return this->transfer(params);
|
||||
}
|
||||
else if (func_name == "test_call")
|
||||
if (func_name == "test_call")
|
||||
{
|
||||
return params;
|
||||
}
|
||||
std::string fuc_name_std = func_name.toStdString();
|
||||
QString response_str;
|
||||
bool r = QMetaObject::invokeMethod(this, fuc_name_std.c_str(), Qt::DirectConnection, Q_RETURN_ARG(QString, response_str), Q_ARG(QString, params));
|
||||
//bool r = this->invokeMethod(fuc_name_std.c_str(), Q_RETURN_ARG(QString, response_str), Q_ARG(QString, params));
|
||||
if (r)
|
||||
return response_str;
|
||||
else
|
||||
{
|
||||
return QString(QString() + "{ \"status\": \"Method '" + func_name + "' not found\"}");
|
||||
return QString(QString() + "{ \"status\": \"Method '" + func_name + "' not found\"}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
QString MainWindow::async_call(const QString& func_name, const QString& params)
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public:
|
|||
QString get_version(const QString& param);
|
||||
QString get_os_version(const QString& param);
|
||||
QString get_network_type(const QString& param);
|
||||
QString transfer(const QString& json_transfer_object);
|
||||
QString transfer(const QString& param);
|
||||
QString have_secure_app_data(const QString& param);
|
||||
QString drop_secure_app_data(const QString& param);
|
||||
QString get_secure_app_data(const QString& param);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue