summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-22 06:42:02 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-22 10:57:51 -0700
commit1ecc9b0cc0c4e7ad2b03236a788cf875189f1832 (patch)
tree15c9c28c046032e22a5ae155b59aa6f502c08848 /qt-ui/profile
parent85dfb88f51098158a5fac52ce432a07625374c70 (diff)
downloadsubsurface-1ecc9b0cc0c4e7ad2b03236a788cf875189f1832.tar.gz
Address uninitialized member warnings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r--qt-ui/profile/divecartesianaxis.cpp4
-rw-r--r--qt-ui/profile/diveprofileitem.cpp7
-rw-r--r--qt-ui/profile/profilewidget2.cpp2
-rw-r--r--qt-ui/profile/ruleritem.cpp6
-rw-r--r--qt-ui/profile/ruleritem.h2
-rw-r--r--qt-ui/profile/tankitem.h2
6 files changed, 16 insertions, 7 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp
index 41d94a9a0..46f1a9656 100644
--- a/qt-ui/profile/divecartesianaxis.cpp
+++ b/qt-ui/profile/divecartesianaxis.cpp
@@ -407,7 +407,9 @@ QString TemperatureAxis::textForValue(double value)
return QString::number(mkelvin_to_C((int)value));
}
-PartialGasPressureAxis::PartialGasPressureAxis()
+PartialGasPressureAxis::PartialGasPressureAxis() :
+ DiveCartesianAxis(),
+ model(NULL)
{
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
}
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
index 373dd0027..5ae46003c 100644
--- a/qt-ui/profile/diveprofileitem.cpp
+++ b/qt-ui/profile/diveprofileitem.cpp
@@ -917,7 +917,9 @@ void PartialPressureGasItem::modelDataChanged(const QModelIndex &topLeft, const
alertPolygons.clear();
QSettings s;
s.beginGroup("TecDetails");
- double threshold = *thresholdPtr;
+ double threshold = 0.0;
+ if (thresholdPtr)
+ threshold = *thresholdPtr;
bool inAlertFragment = false;
for (int i = 0; i < dataModel->rowCount(); i++, entry++) {
double value = dataModel->index(i, vDataColumn).data().toDouble();
@@ -962,7 +964,8 @@ void PartialPressureGasItem::setThreshouldSettingsKey(double *prefPointer)
thresholdPtr = prefPointer;
}
-PartialPressureGasItem::PartialPressureGasItem()
+PartialPressureGasItem::PartialPressureGasItem() :
+ thresholdPtr(NULL)
{
}
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index 9d9bb076c..d422f93f5 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -1777,6 +1777,8 @@ void ProfileWidget2::plotPictures()
y = 10;
else if (fabs(x - lastX) < 4)
y = lastY + 3;
+ else
+ y = 10;
lastX = x;
lastY = y;
item->setPos(x, y);
diff --git a/qt-ui/profile/ruleritem.cpp b/qt-ui/profile/ruleritem.cpp
index d5742ef1d..830985552 100644
--- a/qt-ui/profile/ruleritem.cpp
+++ b/qt-ui/profile/ruleritem.cpp
@@ -8,7 +8,11 @@
#include "profile.h"
-RulerNodeItem2::RulerNodeItem2() : entry(NULL), ruler(NULL)
+RulerNodeItem2::RulerNodeItem2() :
+ entry(NULL),
+ ruler(NULL),
+ timeAxis(NULL),
+ depthAxis(NULL)
{
memset(&pInfo, 0, sizeof(pInfo));
setRect(-8, -8, 16, 16);
diff --git a/qt-ui/profile/ruleritem.h b/qt-ui/profile/ruleritem.h
index 5d144f286..4fad0451c 100644
--- a/qt-ui/profile/ruleritem.h
+++ b/qt-ui/profile/ruleritem.h
@@ -51,8 +51,6 @@ private:
QPointF startPoint, endPoint;
RulerNodeItem2 *source, *dest;
QString text;
- int height;
- int paint_direction;
DiveCartesianAxis *timeAxis;
DiveCartesianAxis *depthAxis;
QGraphicsRectItem *textItemBack;
diff --git a/qt-ui/profile/tankitem.h b/qt-ui/profile/tankitem.h
index 907bc0e34..2ea8e0e57 100644
--- a/qt-ui/profile/tankitem.h
+++ b/qt-ui/profile/tankitem.h
@@ -32,7 +32,7 @@ private:
struct dive diveCylinderStore;
struct plot_data *pInfoEntry;
int pInfoNr;
- qreal yPos, height;
+ qreal height;
QBrush air, nitrox, oxygen, trimix;
QList<QGraphicsRectItem *> rects;
};