mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
remove global mainwindow pointer from AllPlotWindow.cpp
Also remove ugly const cast by introducing MainWindow::mutableIntervalItems.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user