mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-04 13:02:09 +08:00
replay/segment: pass member function pointer to QtConcurrent::run (#23312)
old-commit-hash: 58a363e07d640938e74f938d14dfc5beb6fa1036
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user