From 1d871eb749daaaeed7aec58c637450935f996932 Mon Sep 17 00:00:00 2001 From: Boris Barbulovski Date: Sun, 9 Feb 2014 19:11:17 +0100 Subject: [PATCH] ProfileWidget2 class improvements * Reorder ProfileWidget2 class constructor initialize list. * Initialize(lazy) ProfileWidget2::plotInfo structure. Signed-off-by: Boris Barbulovski Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 8 +++++--- qt-ui/profile/profilewidget2.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 76c560fa6..0f38e5f1a 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -63,10 +63,10 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : temperatureAxis(new TemperatureAxis()), timeAxis(new TimeAxis()), diveProfileItem(new DiveProfileItem()), - cylinderPressureAxis(new DiveCartesianAxis()), - temperatureItem(new DiveTemperatureItem()), - gasPressureItem(new DiveGasPressureItem()), cartesianPlane(new DiveCartesianPlane()), + temperatureItem(new DiveTemperatureItem()), + cylinderPressureAxis(new DiveCartesianAxis()), + gasPressureItem(new DiveGasPressureItem()), meanDepth(new MeanDepthLine()), diveComputerText(new DiveTextItem()), diveCeiling(new DiveCalculatedCeiling()), @@ -75,6 +75,8 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : pheGasItem( new PartialPressureGasItem()), po2GasItem( new PartialPressureGasItem()) { + memset(&plotInfo, 0, sizeof(plotInfo)); + setupSceneAndFlags(); setupItemSizes(); setupItemOnScene(); diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h index ebc45f48a..605d93f58 100644 --- a/qt-ui/profile/profilewidget2.h +++ b/qt-ui/profile/profilewidget2.h @@ -81,7 +81,7 @@ private: // So it's esyer to replicate for more dives later. // In the meantime, keep it here. struct plot_info *plotInfo; - DepthAxis *profileYAxis ; + DepthAxis *profileYAxis; PartialGasPressureAxis *gasYAxis; TemperatureAxis *temperatureAxis; TimeAxis *timeAxis;