From 58a363e07d640938e74f938d14dfc5beb6fa1036 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Tue, 28 Dec 2021 18:38:31 +0800 Subject: [PATCH] replay/segment: pass member function pointer to QtConcurrent::run (#23312) --- selfdrive/ui/replay/route.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/selfdrive/ui/replay/route.cc b/selfdrive/ui/replay/route.cc index 23c27073cbc4c7..4ed832cd52a9fe 100644 --- a/selfdrive/ui/replay/route.cc +++ b/selfdrive/ui/replay/route.cc @@ -91,16 +91,16 @@ void Route::addFileToSegment(int n, const QString &file) { Segment::Segment(int n, const SegmentFile &files, uint32_t flags) : seg_num(n), flags(flags) { // [RoadCam, DriverCam, WideRoadCam, log]. fallback to qcamera/qlog - const QString file_list[] = { + const std::array file_list = { (flags & REPLAY_FLAG_QCAMERA) || files.road_cam.isEmpty() ? files.qcamera : files.road_cam, flags & REPLAY_FLAG_DCAM ? files.driver_cam : "", flags & REPLAY_FLAG_ECAM ? files.wide_road_cam : "", files.rlog.isEmpty() ? files.qlog : files.rlog, }; - for (int i = 0; i < std::size(file_list); i++) { + for (int i = 0; i < file_list.size(); ++i) { if (!file_list[i].isEmpty()) { - loading_++; - synchronizer_.addFuture(QtConcurrent::run([=] { loadFile(i, file_list[i].toStdString()); })); + ++loading_; + synchronizer_.addFuture(QtConcurrent::run(this, &Segment::loadFile, i, file_list[i].toStdString())); } } }