aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/globe.cpp3
-rw-r--r--qt-ui/simplewidgets.cpp10
2 files changed, 9 insertions, 4 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp
index b8e0ec87e..b070da424 100644
--- a/qt-ui/globe.cpp
+++ b/qt-ui/globe.cpp
@@ -38,7 +38,8 @@ GlobeGPS::GlobeGPS(QWidget *parent) : MarbleWidget(parent),
fixZoomTimer(new QTimer(this)),
currentZoomLevel(0),
needResetZoom(false),
- editingDiveLocation(false)
+ editingDiveLocation(false),
+ doubleClick(false)
{
#ifdef MARBLE_SUBSURFACE_BRANCH
// we need to make sure this gets called after the command line arguments have
diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp
index d060e3892..c86094d13 100644
--- a/qt-ui/simplewidgets.cpp
+++ b/qt-ui/simplewidgets.cpp
@@ -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 *)));