summaryrefslogtreecommitdiffstats
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
parent85dfb88f51098158a5fac52ce432a07625374c70 (diff)
downloadsubsurface-1ecc9b0cc0c4e7ad2b03236a788cf875189f1832.tar.gz
Address uninitialized member warnings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--configuredivecomputerthreads.cpp4
-rw-r--r--printer.cpp1
-rw-r--r--qt-models/diveplotdatamodel.cpp5
-rw-r--r--qt-models/divetripmodel.cpp4
-rw-r--r--qt-models/filtermodels.cpp6
-rw-r--r--qt-models/profileprintmodel.cpp1
-rw-r--r--qt-ui/divelogimportdialog.h1
-rw-r--r--qt-ui/diveshareexportdialog.cpp3
-rw-r--r--qt-ui/printdialog.cpp1
-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
-rw-r--r--qt-ui/statistics/statisticswidget.cpp4
-rw-r--r--qt-ui/subsurfacewebservices.cpp4
-rw-r--r--qt-ui/updatemanager.cpp4
-rw-r--r--templatelayout.cpp7
19 files changed, 50 insertions, 18 deletions
diff --git a/configuredivecomputerthreads.cpp b/configuredivecomputerthreads.cpp
index 9939fd17d..5c610db96 100644
--- a/configuredivecomputerthreads.cpp
+++ b/configuredivecomputerthreads.cpp
@@ -1540,7 +1540,9 @@ void ReadSettingsThread::run()
fclose(fp);
}
-WriteSettingsThread::WriteSettingsThread(QObject *parent, device_data_t *data) : DeviceThread(parent, data)
+WriteSettingsThread::WriteSettingsThread(QObject *parent, device_data_t *data) :
+ DeviceThread(parent, data),
+ m_deviceDetails(NULL)
{
}
diff --git a/printer.cpp b/printer.cpp
index 9e5a34b57..79f04e4a0 100644
--- a/printer.cpp
+++ b/printer.cpp
@@ -10,6 +10,7 @@ Printer::Printer(QPrinter *printer, print_options *printOptions)
{
this->printer = printer;
this->printOptions = printOptions;
+ dpi = 0;
done = 0;
}
diff --git a/qt-models/diveplotdatamodel.cpp b/qt-models/diveplotdatamodel.cpp
index 3b3a288b6..f219947ac 100644
--- a/qt-models/diveplotdatamodel.cpp
+++ b/qt-models/diveplotdatamodel.cpp
@@ -4,7 +4,10 @@
#include "graphicsview-common.h"
#include "divelist.h"
-DivePlotDataModel::DivePlotDataModel(QObject *parent) : QAbstractTableModel(parent), diveId(0)
+DivePlotDataModel::DivePlotDataModel(QObject *parent) :
+ QAbstractTableModel(parent),
+ diveId(0),
+ dcNr(0)
{
memset(&pInfo, 0, sizeof(pInfo));
}
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp
index 4934b8b20..3b08e6838 100644
--- a/qt-models/divetripmodel.cpp
+++ b/qt-models/divetripmodel.cpp
@@ -350,7 +350,9 @@ int DiveItem::weight() const
return tw.grams;
}
-DiveTripModel::DiveTripModel(QObject *parent) : TreeModel(parent)
+DiveTripModel::DiveTripModel(QObject *parent) :
+ TreeModel(parent),
+ currentLayout(TREE)
{
columns = COLUMNS;
}
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp
index f63ec85b0..6bec97c23 100644
--- a/qt-models/filtermodels.cpp
+++ b/qt-models/filtermodels.cpp
@@ -292,7 +292,11 @@ void LocationFilterModel::repopulate()
anyChecked = false;
}
-MultiFilterSortModel::MultiFilterSortModel(QObject *parent) : QSortFilterProxyModel(parent), justCleared(false), curr_dive_site(NULL)
+MultiFilterSortModel::MultiFilterSortModel(QObject *parent) :
+ QSortFilterProxyModel(parent),
+ justCleared(false),
+ curr_dive_site(NULL),
+ divesDisplayed(0)
{
}
diff --git a/qt-models/profileprintmodel.cpp b/qt-models/profileprintmodel.cpp
index 1f8d918ed..1d01f6a5d 100644
--- a/qt-models/profileprintmodel.cpp
+++ b/qt-models/profileprintmodel.cpp
@@ -6,6 +6,7 @@
ProfilePrintModel::ProfilePrintModel(QObject *parent)
{
+ fontSize = 12.0;
}
void ProfilePrintModel::setDive(struct dive *divePtr)
diff --git a/qt-ui/divelogimportdialog.h b/qt-ui/divelogimportdialog.h
index e7d068a81..3be267f2c 100644
--- a/qt-ui/divelogimportdialog.h
+++ b/qt-ui/divelogimportdialog.h
@@ -57,7 +57,6 @@ protected:
void dragMoveEvent(QDragMoveEvent *event);
void dropEvent(QDropEvent *event);
private:
- int currentDraggedIndex;
};
class ColumnDropCSVView : public QTableView {
diff --git a/qt-ui/diveshareexportdialog.cpp b/qt-ui/diveshareexportdialog.cpp
index 40670d7fc..27436c66f 100644
--- a/qt-ui/diveshareexportdialog.cpp
+++ b/qt-ui/diveshareexportdialog.cpp
@@ -12,7 +12,8 @@
DiveShareExportDialog::DiveShareExportDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::DiveShareExportDialog),
- reply(NULL)
+ reply(NULL),
+ exportSelected(false)
{
ui->setupUi(this);
}
diff --git a/qt-ui/printdialog.cpp b/qt-ui/printdialog.cpp
index 848183882..4a3314691 100644
--- a/qt-ui/printdialog.cpp
+++ b/qt-ui/printdialog.cpp
@@ -21,6 +21,7 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f
printOptions.color_selected = true;
printOptions.landscape = false;
printOptions.p_template = print_options::ONE_DIVE;
+ printOptions.type = print_options::DIVELIST;
} else {
s.beginGroup(SETTINGS_GROUP);
printOptions.type = (print_options::print_type)s.value("type").toInt();
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;
};
diff --git a/qt-ui/statistics/statisticswidget.cpp b/qt-ui/statistics/statisticswidget.cpp
index 9143c290c..3e91fa317 100644
--- a/qt-ui/statistics/statisticswidget.cpp
+++ b/qt-ui/statistics/statisticswidget.cpp
@@ -2,7 +2,9 @@
#include "yearlystatisticsmodel.h"
#include <QModelIndex>
-YearlyStatisticsWidget::YearlyStatisticsWidget(QWidget *parent): QGraphicsView(parent)
+YearlyStatisticsWidget::YearlyStatisticsWidget(QWidget *parent):
+ QGraphicsView(parent),
+ m_model(NULL)
{
}
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index 969025d9a..c7d8da0eb 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -941,7 +941,9 @@ QNetworkReply* UserSurveyServices::sendSurvey(QString values)
return reply;
}
-CloudStorageAuthenticate::CloudStorageAuthenticate(QObject *parent) : QObject(parent)
+CloudStorageAuthenticate::CloudStorageAuthenticate(QObject *parent) :
+ QObject(parent),
+ reply(NULL)
{
userAgent = getUserAgent();
}
diff --git a/qt-ui/updatemanager.cpp b/qt-ui/updatemanager.cpp
index 8a22400b9..e634a6bc9 100644
--- a/qt-ui/updatemanager.cpp
+++ b/qt-ui/updatemanager.cpp
@@ -8,7 +8,9 @@
#include "version.h"
#include "mainwindow.h"
-UpdateManager::UpdateManager(QObject *parent) : QObject(parent)
+UpdateManager::UpdateManager(QObject *parent) :
+ QObject(parent),
+ isAutomaticCheck(false)
{
// is this the first time this version was run?
QSettings settings;
diff --git a/templatelayout.cpp b/templatelayout.cpp
index 39bb014d6..880b6d774 100644
--- a/templatelayout.cpp
+++ b/templatelayout.cpp
@@ -16,7 +16,8 @@ int getTotalWork()
return dives;
}
-TemplateLayout::TemplateLayout(print_options *PrintOptions)
+TemplateLayout::TemplateLayout(print_options *PrintOptions) :
+ m_engine(NULL)
{
this->PrintOptions = PrintOptions;
}
@@ -80,7 +81,9 @@ QString TemplateLayout::generate()
return htmlContent;
}
-Dive::Dive()
+Dive::Dive() :
+ m_number(-1),
+ dive(NULL)
{
}