mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 16:39:57 +00:00
Fix first file SEGV
If you delete and readd an activity after showing it on the diary view you get a SEGV. This is an edge case related to deleting the last activity and going back to the blank state before importing another. Actually there are 3 technical issues; 1. GcCalendar doesn't get notified by MainWindow when there are no rides -- so it crashes on refresh 2. RideSummaryWindow doesn't get notified by home window if its not visible 3. RideSummaryWindow should check rideItem isn't NULL before trying to plot zones (but only for date range summaries) Fixes #622
This commit is contained in:
@@ -1249,13 +1249,13 @@ MainWindow::rideTreeWidgetSelectionChanged()
|
||||
// update the ride property on all widgets
|
||||
// to let them know they need to replot new
|
||||
// selected ride
|
||||
gcCalendar->setRide(ride);
|
||||
gcMultiCalendar->setRide(ride);
|
||||
_rideMetadata->setProperty("ride", QVariant::fromValue<RideItem*>(dynamic_cast<RideItem*>(ride)));
|
||||
analWindow->setProperty("ride", QVariant::fromValue<RideItem*>(dynamic_cast<RideItem*>(ride)));
|
||||
homeWindow->setProperty("ride", QVariant::fromValue<RideItem*>(dynamic_cast<RideItem*>(ride)));
|
||||
diaryWindow->setProperty("ride", QVariant::fromValue<RideItem*>(dynamic_cast<RideItem*>(ride)));
|
||||
trainWindow->setProperty("ride", QVariant::fromValue<RideItem*>(dynamic_cast<RideItem*>(ride)));
|
||||
gcCalendar->setRide(ride);
|
||||
gcMultiCalendar->setRide(ride);
|
||||
|
||||
if (!ride) return;
|
||||
|
||||
@@ -1990,6 +1990,8 @@ MainWindow::removeCurrentRide()
|
||||
if (allRides->childCount() == 0) {
|
||||
ride = NULL;
|
||||
rideTreeWidgetSelectionChanged(); // notifies children
|
||||
gcCalendar->setRide(ride); // and the pesky calendars
|
||||
gcMultiCalendar->setRide(ride);
|
||||
}
|
||||
|
||||
treeWidget->setCurrentItem(itemToSelect);
|
||||
|
||||
Reference in New Issue
Block a user