mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Initialize members
Globe: initialize doubleClick member ShiftTimesDialog: initialize when (not sure this could be a problem) SetpointDialog: dc could be uninitialized or could be 0 and dereferenced Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
83a5778f62
commit
a6e9db196f
2 changed files with 9 additions and 4 deletions
|
|
@ -181,13 +181,15 @@ void SetpointDialog::setpointData(struct divecomputer *divecomputer, int second)
|
|||
|
||||
void SetpointDialog::buttonClicked(QAbstractButton *button)
|
||||
{
|
||||
if (ui.buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole)
|
||||
if (ui.buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole && dc)
|
||||
add_event(dc, time, SAMPLE_EVENT_PO2, 0, (int)(1000.0 * ui.spinbox->value()), "SP change");
|
||||
mark_divelist_changed(true);
|
||||
MainWindow::instance()->graphics()->replot();
|
||||
}
|
||||
|
||||
SetpointDialog::SetpointDialog(QWidget *parent) : QDialog(parent)
|
||||
SetpointDialog::SetpointDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
dc(0)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
|
||||
|
|
@ -251,7 +253,9 @@ void ShiftTimesDialog::changeTime()
|
|||
ui.shiftedTime->setText(get_dive_date_string(amount + when));
|
||||
}
|
||||
|
||||
ShiftTimesDialog::ShiftTimesDialog(QWidget *parent) : QDialog(parent)
|
||||
ShiftTimesDialog::ShiftTimesDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
when(0)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue