Replay: make response a const reference in parseResponse (#20787)

old-commit-hash: 228308b719
commatwo_master
Dean Lee 4 years ago committed by GitHub
parent ee9280d9d3
commit 5957d8cc05
  1. 7
      selfdrive/ui/replay/replay.cc
  2. 2
      selfdrive/ui/replay/replay.hpp

@ -10,12 +10,11 @@ Replay::Replay(QString route_, int seek) : route(route_) {
#endif
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){
response = response.trimmed();
QJsonDocument doc = QJsonDocument::fromJson(response.toUtf8());
void Replay::parseResponse(const QString &response){
QJsonDocument doc = QJsonDocument::fromJson(response.trimmed().toUtf8());
if (doc.isNull()) {
qDebug() << "JSON Parse failed";

@ -29,7 +29,7 @@ public:
QQueue<int> event_sizes;
public slots:
void parseResponse(QString response);
void parseResponse(const QString &response);
protected:
Unlogger *unlogger;

Loading…
Cancel
Save