|
|
@ -10,12 +10,11 @@ Replay::Replay(QString route_, int seek) : route(route_) { |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
http = new HttpRequest(this, "https://api.commadotai.com/v1/route/" + route + "/files", "", create_jwt); |
|
|
|
http = new HttpRequest(this, "https://api.commadotai.com/v1/route/" + route + "/files", "", create_jwt); |
|
|
|
QObject::connect(http, SIGNAL(receivedResponse(QString)), this, SLOT(parseResponse(QString))); |
|
|
|
QObject::connect(http, &HttpRequest::receivedResponse, this, &Replay::parseResponse); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Replay::parseResponse(QString response){ |
|
|
|
void Replay::parseResponse(const QString &response){ |
|
|
|
response = response.trimmed(); |
|
|
|
QJsonDocument doc = QJsonDocument::fromJson(response.trimmed().toUtf8()); |
|
|
|
QJsonDocument doc = QJsonDocument::fromJson(response.toUtf8()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (doc.isNull()) { |
|
|
|
if (doc.isNull()) { |
|
|
|
qDebug() << "JSON Parse failed"; |
|
|
|
qDebug() << "JSON Parse failed"; |
|
|
|