Skip to content

Commit

Permalink
FIT: remove duplicates from the device infos
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dhewg committed Jul 17, 2017
1 parent dc8c9d7 commit c3ee9ed
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/FileIO/FitRideFile.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit c3ee9ed

Please sign in to comment.