ignore rides that don't load properly

Need to call item->ride() in order to load the ride, and should ignore those
for which the result is NULL.  Do this after checking the date, though, so
that we don't load older rides into memory.
This commit is contained in:
Sean Rhea
2010-01-02 12:52:54 -05:00
parent 400fd23692
commit 46db59eec1

View File

@@ -991,9 +991,9 @@ void MainWindow::getBSFactors(float &timeBS, float &distanceBS)
for (int i = 0; i < allRides->childCount(); ++i) {
RideItem *item = (RideItem*) allRides->child(i);
int days = item->dateTime.daysTo(lastRideItem->dateTime);
if ((item->type() == RIDE_TYPE) &&
// (item->ride) &&
(days >= 0) && (days < BSdays.toInt())) {
if ((item->type() == RIDE_TYPE)
&& (days >= 0) && (days < BSdays.toInt())
&& (item->ride())) {
RideMetricPtr m;
item->computeMetrics();