ProfileWidget2 class improvements

* Reorder ProfileWidget2 class constructor initialize list.
* Initialize(lazy) ProfileWidget2::plotInfo structure.

Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Boris Barbulovski 2014-02-09 19:11:17 +01:00 committed by Dirk Hohndel
parent 8bb5cd6012
commit 1d871eb749
2 changed files with 6 additions and 4 deletions

View file

@ -63,10 +63,10 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
temperatureAxis(new TemperatureAxis()), temperatureAxis(new TemperatureAxis()),
timeAxis(new TimeAxis()), timeAxis(new TimeAxis()),
diveProfileItem(new DiveProfileItem()), diveProfileItem(new DiveProfileItem()),
cylinderPressureAxis(new DiveCartesianAxis()),
temperatureItem(new DiveTemperatureItem()),
gasPressureItem(new DiveGasPressureItem()),
cartesianPlane(new DiveCartesianPlane()), cartesianPlane(new DiveCartesianPlane()),
temperatureItem(new DiveTemperatureItem()),
cylinderPressureAxis(new DiveCartesianAxis()),
gasPressureItem(new DiveGasPressureItem()),
meanDepth(new MeanDepthLine()), meanDepth(new MeanDepthLine()),
diveComputerText(new DiveTextItem()), diveComputerText(new DiveTextItem()),
diveCeiling(new DiveCalculatedCeiling()), diveCeiling(new DiveCalculatedCeiling()),
@ -75,6 +75,8 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
pheGasItem( new PartialPressureGasItem()), pheGasItem( new PartialPressureGasItem()),
po2GasItem( new PartialPressureGasItem()) po2GasItem( new PartialPressureGasItem())
{ {
memset(&plotInfo, 0, sizeof(plotInfo));
setupSceneAndFlags(); setupSceneAndFlags();
setupItemSizes(); setupItemSizes();
setupItemOnScene(); setupItemOnScene();

View file

@ -81,7 +81,7 @@ private:
// So it's esyer to replicate for more dives later. // So it's esyer to replicate for more dives later.
// In the meantime, keep it here. // In the meantime, keep it here.
struct plot_info *plotInfo; struct plot_info *plotInfo;
DepthAxis *profileYAxis ; DepthAxis *profileYAxis;
PartialGasPressureAxis *gasYAxis; PartialGasPressureAxis *gasYAxis;
TemperatureAxis *temperatureAxis; TemperatureAxis *temperatureAxis;
TimeAxis *timeAxis; TimeAxis *timeAxis;