diff --git a/src/CpintPlot.cpp b/src/CpintPlot.cpp index 7009eeb47..4f3d33340 100644 --- a/src/CpintPlot.cpp +++ b/src/CpintPlot.cpp @@ -37,12 +37,12 @@ #define USE_T0_IN_CP_MODEL 0 // added djconnel 08Apr2009: allow 3-parameter CP model -CpintPlot::CpintPlot(QString p) : +CpintPlot::CpintPlot(QString p, const Zones *zones) : needToScanRides(true), path(p), thisCurve(NULL), CPCurve(NULL), - zones(NULL), + zones(zones), energyMode_(false) { assert(!USE_T0_IN_CP_MODEL); // doesn't work with energyMode=true @@ -585,7 +585,6 @@ CpintPlot::calculate(RideItem *rideItem) QDateTime dateTime = rideItem->dateTime; QDir dir(path); QFileInfo file(fileName); - zones = rideItem->zones; if (needToScanRides) { bests.clear(); diff --git a/src/CpintPlot.h b/src/CpintPlot.h index 9dd381c7e..391b714be 100644 --- a/src/CpintPlot.h +++ b/src/CpintPlot.h @@ -36,7 +36,7 @@ class CpintPlot : public QwtPlot public: - CpintPlot(QString path); + CpintPlot(QString path, const Zones *zones); bool needToScanRides; const QwtPlotCurve *getThisCurve() const { return thisCurve; } @@ -72,7 +72,7 @@ class CpintPlot : public QwtPlot QVector bestDates; QDate startDate; QDate endDate; - Zones *zones; + const Zones *zones; // keys are CPI files contributing to bests (at least originally) QHash cpiDataInBests; bool energyMode_; diff --git a/src/CriticalPowerWindow.cpp b/src/CriticalPowerWindow.cpp index e628f5522..e7a80dd11 100644 --- a/src/CriticalPowerWindow.cpp +++ b/src/CriticalPowerWindow.cpp @@ -34,7 +34,7 @@ CriticalPowerWindow::CriticalPowerWindow(const QDir &home, MainWindow *parent) : { QVBoxLayout *vlayout = new QVBoxLayout; - cpintPlot = new CpintPlot(home.path()); + cpintPlot = new CpintPlot(home.path(), mainWindow->zones); vlayout->addWidget(cpintPlot); QFormLayout *cpintPickerLayout = new QFormLayout;