Remove Globals from ErgFilePlot

The original ErgFilePlot code used local static variables
to bridge between the selected ErgFile and the Qwt data
handlers.

This was not an issue when we only allowed one chart of this
type to be available at once. But now, with a more configurable
layout it is possible to have multiple.

The currently selected ErgFile can now be referenced from
MainWindow in the same manner as the current RideFile can.

This patch introduces no functional change for users.
This commit is contained in:
Mark Liversedge
2011-11-05 13:06:31 +00:00
parent cd6e9df377
commit 368aeba04d
6 changed files with 66 additions and 34 deletions

View File

@@ -30,7 +30,7 @@ WorkoutPlotWindow::WorkoutPlotWindow(MainWindow *mainWindow) :
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setSpacing(0);
layout->setContentsMargins(2,2,2,2);
ergPlot = new ErgFilePlot(0);
ergPlot = new ErgFilePlot(mainWindow);
layout->addWidget(ergPlot);
connect(mainWindow, SIGNAL(setNow(long)), this, SLOT(setNow(long)));