More NULL ride bug fixes

The controls for the RideEditor (find) and AllPlotWindow
still try and do their thing when the current ride item
is NULL. This was either because it wasn't checked (or
expected) or the widgets in question were not notified. This
patch fixes this.

When I get a chance the whole codebase needs to be refactored
to gracefully handle NULL rideItems -- each plot/window should
clear state when it is notified that NO ride is selected.
This commit is contained in:
Mark Liversedge
2011-04-17 21:29:16 +01:00
parent f1b90ced62
commit c8c6c22ab7
4 changed files with 49 additions and 9 deletions

View File

@@ -277,7 +277,8 @@ void
RideFileTableModel::forceRedraw()
{
// tell the view to redraw everything
dataChanged(createIndex(0,0), createIndex(headingsType.count(), ride->dataPoints().count()));
if (ride)
dataChanged(createIndex(0,0), createIndex(headingsType.count(), ride->dataPoints().count()));
}
//