Replay: make response a const reference in parseResponse (#20787)
parent
ad57cd3759
commit
228308b719
|
@ -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";
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
QQueue<int> event_sizes;
|
QQueue<int> event_sizes;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void parseResponse(QString response);
|
void parseResponse(const QString &response);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Unlogger *unlogger;
|
Unlogger *unlogger;
|
||||||
|
|
Loading…
Reference in New Issue