RideFile reading refactoring

With the introduction of the rideSelected signal the RideFile was
opened (as previously) by the RideSummaryWindow::htmlSummary()
member. In some cases, this signal was processed by RideSummary window
AFTER the other charts (AllPlot etc) this results in 'No data' being
shown on other charts.

This patch moves the file reading to RideItem::ride() which was previously
a public RideFile * (that is now a protected member ride_). As a happy by
product it removes the need to check if the file has already been read
across all other functions ensuring in-core values are not accidentally
overwritten. The read errors are made available by a new RideItem::errors()
member.

This modification is required to support the RideImportWizard in freeing
loaded RideFiles during batch import to ensure virtual memory is not
exhausted when large numbers of files are imported at once. This modification
is also included in this patch.
This commit is contained in:
Mark Liversedge
2009-12-18 19:05:13 +00:00
committed by Sean Rhea
parent 71d67e2203
commit feb111a4ff
12 changed files with 68 additions and 60 deletions

View File

@@ -200,7 +200,7 @@ WeeklySummaryWindow::refresh()
) {
item->computeMetrics(); // generates item->ride
if (!item->ride)
if (!item->ride())
continue;
RideMetric *m;