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 97053386d8
commit 7a63d1f5dc
4 changed files with 49 additions and 9 deletions

View File

@@ -897,6 +897,12 @@ MainWindow::removeCurrentRide()
rideDeleted(item);
delete item;
// any left?
if (allRides->childCount() == 0) {
ride = NULL;
rideTreeWidgetSelectionChanged(); // notifies children
}
// added djconnel: remove old cpi file, then update bests which are associated with the file
criticalPowerWindow->deleteCpiFile(strOldFileName);