void LocalClient::processResponse() { QJsonRpcServiceReply *reply = static_cast<QJsonRpcServiceReply *>(sender()); if (!reply) { qDebug() << "invalid response received"; return; } qDebug() << "response received: " << reply->response(); }
void DlvClient::finishedCommandReply() { m_isCommandBlock = false; QJsonRpcServiceReply *reply = (QJsonRpcServiceReply*)(sender()); m_lastJsonData = reply->response().result().toVariant(); if (reply->response().type() == QJsonRpcMessage::Error) { int code = reply->response().errorCode(); QString msg = reply->response().errorMessage(); if (msg.isEmpty()) { ResponseError resp; resp.fromMap(reply->response().toObject().toVariantMap()); msg = resp.error; } emit commandError(code,msg); } else { CommandOut out; QVariant data = reply->response().result().toVariant(); out.fromMap(data.toMap()); emit commandSuccess(m_lastCommand.Name,out.State,data.toMap()); } }