Ensure default sport for zones

This commit is contained in:
Alejandro Martinez
2021-06-06 05:28:40 -03:00
parent 6e4dba86f0
commit 2b063c91c2

View File

@@ -490,7 +490,11 @@ RideMetadata::sports()
}
// Ensure default sport
if (sportList.isEmpty()) sportList << "Bike";
bool hasBike = false;
foreach (QString sport, sportList) {
if (RideFile::sportTag(sport) == "Bike") hasBike = true;
}
if (!hasBike) sportList.prepend("Bike");
return sportList;
}