From 46db59eec1c9b68be32cf59df7eac5a45bdc696b Mon Sep 17 00:00:00 2001 From: Sean Rhea Date: Sat, 2 Jan 2010 12:52:54 -0500 Subject: [PATCH] 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. --- src/MainWindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 02bbff078..7a4b5408d 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -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();