mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 00:28:42 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user