diff --git a/src/AllPlotWindow.cpp b/src/AllPlotWindow.cpp index 204dd5951..93fd9cb68 100644 --- a/src/AllPlotWindow.cpp +++ b/src/AllPlotWindow.cpp @@ -324,7 +324,7 @@ AllPlotWindow::setEndSelection(double xValue, bool newInterval, QString name) RideFile tmpRide = RideFile(); - QTreeWidgetItem *which = mainwindow->rideItem(); + QTreeWidgetItem *which = mainWindow->rideItem(); RideItem *ride = (RideItem*)which; double distance1 = -1; @@ -393,7 +393,7 @@ AllPlotWindow::setEndSelection(double xValue, bool newInterval, QString name) if (newInterval) { - QTreeWidgetItem *allIntervals = (QTreeWidgetItem *)mainwindow->allIntervalItems(); + QTreeWidgetItem *allIntervals = mainWindow->mutableIntervalItems(); int count = allIntervals->childCount(); // are we adjusting an existing interval? - if so delete it and readd it @@ -406,7 +406,7 @@ AllPlotWindow::setEndSelection(double xValue, bool newInterval, QString name) allIntervals->addChild(last); // now update the RideFileIntervals and all the plots etc - mainwindow->updateRideFileIntervals(); + mainWindow->updateRideFileIntervals(); } } } diff --git a/src/MainWindow.h b/src/MainWindow.h index 0065eceb1..b520f177b 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -55,6 +55,7 @@ class MainWindow : public QMainWindow const RideItem *currentRideItem() { return ride; } const QTreeWidgetItem *allRideItems() { return allRides; } const QTreeWidgetItem *allIntervalItems() { return allIntervals; } + QTreeWidgetItem *mutableIntervalItems() { return allIntervals; } void getBSFactors(float &timeBS, float &distanceBS); QDir home; void setCriticalPower(int cp);