From 2d3e48f4ae0c0137030988451e3fcb42c2320a8d Mon Sep 17 00:00:00 2001 From: Boris Barbulovski Date: Sun, 9 Feb 2014 18:13:34 +0100 Subject: diveplanner.cpp cleanup * Add missing DivePlannerPointsModel::tempDive to the constructor initialize list. * ExpanderGraphics class: Construct pointer-variable members into initialize list, Signed-off-by: Boris Barbulovski Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 4e1865fc6..85703bf54 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -1117,7 +1117,7 @@ int DivePlannerPointsModel::rowCount(const QModelIndex& parent) const return divepoints.count(); } -DivePlannerPointsModel::DivePlannerPointsModel(QObject* parent): QAbstractTableModel(parent), mode(NOTHING), stagingDive(NULL) +DivePlannerPointsModel::DivePlannerPointsModel(QObject* parent): QAbstractTableModel(parent), mode(NOTHING), tempDive(NULL), stagingDive(NULL) { diveplan.dp = NULL; } @@ -1508,13 +1508,14 @@ void DivePlannerPointsModel::createPlan() CylindersModel::instance()->update(); } -ExpanderGraphics::ExpanderGraphics(QGraphicsItem* parent): QGraphicsRectItem(parent) +ExpanderGraphics::ExpanderGraphics(QGraphicsItem* parent) : QGraphicsRectItem(parent), + icon(new QGraphicsPixmapItem(this)), + increaseBtn(new Button(0, this)), + decreaseBtn(new Button(0, this)), + bg(new QGraphicsPixmapItem(this)), + leftWing(new QGraphicsPixmapItem(this)), + rightWing(new QGraphicsPixmapItem(this)) { - icon = new QGraphicsPixmapItem(this); - bg = new QGraphicsPixmapItem(this); - leftWing = new QGraphicsPixmapItem(this); - rightWing = new QGraphicsPixmapItem(this); - QPixmap p; #define CREATE(item, pixmap) \ p = QPixmap(QString( pixmap ));\ @@ -1526,8 +1527,6 @@ ExpanderGraphics::ExpanderGraphics(QGraphicsItem* parent): QGraphicsRectItem(par CREATE(rightWing, ":right_wing"); #undef CREATE - decreaseBtn = new Button(0, this); - increaseBtn = new Button(0, this); decreaseBtn->setPixmap(QPixmap(":arrow_down")); increaseBtn->setPixmap(QPixmap(":arrow_up")); -- cgit v1.2.3-70-g09d2