FIT: remove duplicates from the device infos

There're scenarios where the attached devices get added again, e.g.
a power cycle. Filter out the duplicates so each member only gets listed
once.
This commit is contained in:
Andre Heider
2017-07-15 16:36:54 +02:00
parent dc8c9d7f64
commit c3ee9ed685

View File

@@ -2830,11 +2830,10 @@ struct FitFileReaderState
foreach(int num, unknown_base_type)
qDebug() << QString("FitRideFile: unknown base type %1; skipped").arg(num);
QString deviceInfo;
foreach(QString info, deviceInfos) {
deviceInfo += info + "\n";
}
if (deviceInfo.length()>0)
QStringList uniqueDevices(deviceInfos.values());
uniqueDevices.removeDuplicates();
QString deviceInfo = uniqueDevices.join('\n');
if (not deviceInfo.isEmpty())
rideFile->setTag("Device Info", deviceInfo);
QString dataInfo;